get_search_article_similarities: Similarities between term vector and article vector

Description Usage Arguments Details Value Examples

View source: R/get_search_article_similarities.R

Description

Similarities between term vector and article vector

Usage

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)

Arguments

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 WordVectors matrix

w_vectors

matrix containing semantic vectors for each word (e.g., WordVectors from the sample data in this package)

a_vectors

matrix containing semantic vectors for each article (e.g., article_vectors from the sample data)

a_df

dataframe containing necessary abstract information (e.g., article_df from sample data)

query_type

integer, 1 = compound search, 2 = AND search, 3 = OR search

Details

The returned dataframe includes the following:

Value

a dataframe containing article information

Examples

1
2
3
search <- c("president")
article_dataframe <- get_search_article_similarities(search,query_type=1)
knitr::kable(head(article_dataframe))

CrumpLab/RsemanticLibrarian documentation built on Nov. 11, 2019, 1:04 p.m.