NIVEL DE CONOCIMIENTO Y MANEJO DE PROTOCOLOS
3.3.3. Actividad 3 Conocer la metodología del protocolo médico
The pseudo code of this procedure, which is implemented as part of the relaxation expansion function, is presented in Algorithm 16.
repre-sentation of words, first proposed in (Mikolov et al., 2013a): each object (represented by its Freebase MID) is associated with a 1000-dimension vector of numbers. The vector representations are learned by neural network model based on a large corpus of natural language data, which has been shown to capture semantic properties well (Mikolov et al., 2013b). The similarity score between two objects is computed using the cosine similarity between their vectors: higher scores mean they are more sim-ilar. The vector model of BCDR is trained by the continuous skip-gram algorithm in the word2vec package with a Google News dataset (Word2Vec, 2013). For ex-ample, Figure 6-3 presents the semantic similarity scores between a few alternative cuisines and movie genres in Simon’s problem. Out of four alternative cuisines to Chinese, Korean and Thai are closer in distance, with similarity scores of 0.7140 and 0.6945, while Mexican and American cuisine are further away with scores of 0.5169 and 0.3183, respectively. With the semantic similarity measurement, BCDR is able to explore the domain relaxations in best-first order, like prior approaches did for temporal relaxations.
Cuisine CHINESE m.01xw9
KOREAN m.048vr 0.7140
THAI m.07hxn
0.6945
MEXICAN m.051zk 0.5169
AMERICAN m.01z1zf2 0.3183
Genre COMEDY m.05p553
DRAMA m.02822
0.5940
ROMANCE m.02l7c8 0.3652
WAR m.082gq
0.3069 DOCUMENTARY
m.0jtdp 0.3287
Figure 6-3: Semantic distances between cuisines and genres
The accuracy of word2vec’s distance measurement is dependent on the amount of data used in training: it is often more reliable for domains that are commonly encountered in web contents and publications. In addition, the distance measurement is an indication of commonsense, and does not reflect the difference in individuals’
perceptions. For example, some people may find Vietnamese food are very different from French food due to the geographic separation of the two countries, while some may find them to be quite similar due to the French influence on Vietnamese cuisine.
The word vector model currently used by BCDR only covers about 1.4 million out
of 50 million topics in Freebase due to the corpus used in training. When asked to compare with an object with an undefined vector, the similarity measurement will return zero, which greatly reduces the chance that this object will be considered in relaxation. This limitation was observed during our experiments, and we are working on a backup measure with better coverage to address this issue.
Finally, as the cost functions defined over temporal relaxations and domain relax-ations are not compatible (weighted linear cost vs. cosine distance and conditional probability), we normalized the cosine distance by computing its inverse (1/distance) and used it as the cost for domain relaxations.
6.2.1 Alternative Preference Model for Single-Valued Domains
In some scenarios, the activities specified by the users may not be a collection of candidates. Instead, they want to visit a specific restaurant or grocery store. For example, in Simon’s evening trip example, he may only prefer to visit the restaurant Magic Wok, instead of any Chinese restaurant. In this case, the domain constraints for the variable𝑅𝑒𝑠𝑡𝑎𝑢𝑟𝑎𝑛𝑡will simply be one equality relation, such as the following SparQL query:
∙ Chinese Restaurant: SELECT ?r WHERE{
?r ns:type.object.type ns:dining.restaurant.
FILTER (?r = <Magic Wok>).}
In such situations, the word2vec model is not able to help prioritize alternative relaxations, since it was trained only on general concepts representing the classes of candidates, not on individual instances. Therefore, to support the relaxation for such domains, we integrated an alternative preference model, called Semantic Memory, which operates on individual instances and supports the comparison of them. First presented in (Raiman, 2016), Semantic Memory uses an ontology to keep track of historical user behavior and rank candidates using the discovered preference. Seman-tic Memory works directly with the description of individual instances, whether it is a restaurant, grocery store or a gas station. It builds an ontology, called a User
Profile, over the candidate options from categorized (e.g. rating, cuisine, genre) and uncategorized language data (e.g. reviews). It also supports model updates through interactions with the users, reasoning about preferences hierarchically, and dynamic acquisition of new choices.
The implementation of Semantic Memory includes two components:
∙ Reader Module: the Reader Module uses a novel topic model, also presented in (Raiman, 2016), to obtain vector representations of choices from their associated textual descriptions and categorized metadata. The resulting vectors are used to build and update the User Profile.
∙ Memory Module: the Memory Module builds the User Profile, an ontology for each user the system keeps track of. The ontology is constructed as a weighted tree with all possible options available for a variable domain as leaves.
The relationship between child and parent nodes in the ontology follow an is-a relationship: neighbors and parents are thereby semantically similar. At each leaf node a label holding the user’s preference can be in three states: likes, dislikes, unknown. The Semantic Memory uses these labels to rank the options for BCDR during relaxation.
To support the update of User Profile, BCDR will also forward the rejection from the users on a candidate solution to the Semantic Memory package. The update allows the User Profile for the user to be updated for future use, which will order the candidates differently the next time BCDR gets into the same situation (Figure 6-4).
We use the same example from Section 4.2 to demonstrate the behavior of BCDR working with Semantic Memory (Figure 6-5). Assume that there are four additional restaurants available for selection, in addition to Magic Wok, which does not meet Simon and Christian’s requirements. Semantic Memory organizes them into a tree using their vector representations. It then computes the commute distance from the other four restaurants to Magic Wok using the inference procedures described in (Kemp & Tenenbaum, 2008). First presented to model humans’ structural learning of concepts, the commute distance is defined on graphs for making predictions about the
Knowledge Base
BCDR
Freebase Restaurants Movie Showings
Map & Rounting Function User:
Plan &
Relaxations
Semantic Memory
TPN &
Feedbacks
Domain Values Semantic
Queries
Routes Domain
Relaxation Candidates Feedbacks
NextBestCandidate() UpdateWeightScore()
Figure 6-4: The interactions between BCDR and Semantic Memory
similarity between concepts: given that leaf node X is in category A, it indicates how likely is leaf node Y also in category A. It takes into account of not only the distance between graph nodes, but also the number of different paths connecting them. Here, the concept of being in a category represents being preferred by Simon. We set the node representing Magic Wok to have value 1 (given that he asked for it from the beginning). Using the tree+diffusion model from (Kemp & Tenenbaum, 2008), we can compute the covariance matrix corresponding to the tree, which can then help us estimate the likelihood that the states of the other four leaf nodes being 1. As shown in the figure, having both A and B to be preferred by Simon is more likely than the other three restaurants.
Magic Wok Panda Exp.
A B C D E
JSJ Sunnybowl Bb
A B C D E P(A,B|S) = 0.5300 P(A,C|S) = 0.5018
Figure 6-5: Domain Relaxation with Semantic Memory (S represents the matrix that encodes the tree structure)
Compared to word2vec, which has a very wide coverage with a model trained on a large corpus, Semantic Memory requires a much smaller but detailed training
set. It has a limited coverage, while in return, provides much higher resolution of the recommendations, and is designed to be personalized for different users. It is a good complement for the word2vec model in uncommon domains or domains with too many candidates. On the other hand, the distance measure returned from Semantic Memory is a conditional probability, which is not the same as the cosine distance from word2vec, even though they are in the same range. The integration of the two different types of distance measure is part of our future work to explore.