text-to-topic-tokens
ai-research-agent / tokenize/text-to-topic-tokens
Other
Token
Properties
term
term: string;
The actual term or phrase
termCategory
termCategory: number;
The category of the term
uniqueness
uniqueness: number;
The uniqueness score of the term
Topics
convertTextToTokens()
function convertTextToTokens(phrase, options?): object[]
Convert Text Query to Topic Phrase Tokens
Returns a list of phrases that are found in Wiki Titles/ dictionary phrases World Model that match the input phrase, or just the single word if found. Search results will be more accurate if we infer likely phrases and search for those words occuring together and not just split into words and find frequency. Examples are "white house" or "state of the art" which should be searched as a phrase but would return different context if split into words. As Led Zeppelin famously put it: ♫ "'Cause you know sometimes words have two meanings."
Parameters
Parameter | Type | Description |
---|---|---|
|
| |
| { | |
|
| check for word's root stem |
|
| check for typos |
|
| ignore 300+ overused words |
|
| remote model |
|
| remote model |
Returns
object
[]
Example
const result = convertTextToTokens("The president of the united states is in the white house", { phrasesModel, typosModel });
console.log(result);