Description Usage Arguments Details Value Examples
View source: R/get_search_article_similarities.R
Similarities between term vector and article vector
1 2 3 | get_search_article_similarities(search_terms, d_words = dictionary_words,
w_vectors = WordVectors, a_vectors = article_vectors,
a_df = article_df, query_type)
|
search_terms |
character vector containing search terms (words must appear in dictionary) |
d_words |
character vector containing the corpus dictionary, the indexes of the words in the dictionary should match the row indices of the |
w_vectors |
matrix containing semantic vectors for each word (e.g., |
a_vectors |
matrix containing semantic vectors for each article (e.g., |
a_df |
dataframe containing necessary abstract information (e.g., |
query_type |
integer, 1 = compound search, 2 = AND search, 3 = OR search |
The returned dataframe includes the following:
formatted_column
: html printable abstract information
title
: abstract title
wrap_title
: wrapped title with html breaks
year
: abstract year
index
: index refering to the row vector in the article_vectors
matrix
Similarity
: cosine similarity between search terms and current abstract
a dataframe containing article information
1 2 3 | search <- c("president")
article_dataframe <- get_search_article_similarities(search,query_type=1)
knitr::kable(head(article_dataframe))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.