similarity_map: Create a semantic map of a keyword

View source: R/similarity_map.R

similarity_mapR Documentation

Create a semantic map of a keyword

Description

Build a scatterplot that represents the conceptual structure of a keyword.

Usage

similarity_map(
  mat,
  keyword,
  method = "cosine",
  margin = 1,
  numResults = 40,
  numGrps = 5
)

Arguments

mat

A word-context matrix.

keyword

A string.

method

A character string: 'cosine', 'euclidean', 'pearson' or 'covariance', which names the mathematical similarity test to be performed. Default is 'cosine'.

margin

Numeric value: 1 or 2. If 1, calculations are performed over the rows. If 2, over the columns.

numResults

Numeric value. The number of words to be displayed in the graph. Default is 40.

numGrps

Numeric value. The number of groups in which you'd like to divide the display. Default is 5.

Value

A scatterplot showing structure of 30 most-similar words.

What it does

This function runs similarity over a word-context matrix and looks for the thirty most similar terms, then clusters them.


michaelgavin/litmath documentation built on Oct. 20, 2023, 9:20 a.m.