@ector/core
is the chat core of ECTOR.
const ECTOR = require('@ector/core');
let ector = {
name: 'ECTOR',
username: 'Guy'
};
ector = ECTOR.addEntry('Hello ECTOR!');
ector = ECTOR.generateResponse(ector);
const response = ECTOR.getResponse(ector);
console.log(response);
should give
Hello Guy!
- ECTOR
- addEntry
- choseToken
- generateForwards
- generateBackwards
- generateResponse
- linkNodesToLastSentence
- getResponse
name
string? name of the botusername
string? name of the usercn
ConceptNetwork?cns
Object<string, ConceptNetworkState>? One state per usernamelastSentenceLabel
string? Label of the last entry first sentencelastTokenLabels
Array<string>? Labels of the last entry tokensresponse
string? Generated responseresponseLabels
Array<string>? Nodes of the response
Add an entry to ector's model.
Chose one token label from the activated ones.
state
ConceptNetworkStatetemperature
number
Returns string The chosen token
Generate the end of a sentence, adding tokens to the list of token nodes in phrase.
cn
ConceptNetwork Network of tokenscns
ConceptNetworkState State of the network (activation values)phraseNodes
Array<{id: string, weight: number}> array of token nodestemperature
number
Returns Array<{id: string, weight: number}> array of token nodes (end of phrase) *
Generate the begining of a sentence, adding tokens to the list of token nodes in phrase.
cn
ConceptNetwork Network of tokenscns
ConceptNetworkState State of the network (activation values)phraseNodes
Array<{id: string, weight: number}> array of token nodestemperature
number
Returns Array<{id: string, weight: number}> array of token nodes (end of phrase) *
Generate a response from the activated nodes.
ector
ECTOR
Returns ECTOR
Link nodes to the previous sentence node label (this is automatically set by addEntry, it is the node label of the first sentence of the entry).
Used with the nodes returned by addEntry.
Returns ECTOR *
Get the response already generated with generateResponse.
ector
ECTOR
Returns string