0.0.4 • Published 7 years ago
@topica314/apitore v0.0.4
apitore
Apitore API wrapper for NLP
usage
const Nlp = require('@topica314/apitore');
const ACCESS_TOKEN = 'YOUR_ACCESS_TOKEN';
const nlp = Nlp.create(ACCESS_TOKEN);
docs
Nlp Apitoreのwrapper
@method tokenize
@param text {string} 形態素分解したい文
@return {promise} tokens {object} をresolve
@method wordVector
@param word {string} ベクトルに変換したい単語
@return {promise} vector {vector} をresolve
@method vecDistance
@param vector {vector} 単語に変換したいベクトル
@param num {number} 取得する単語の数
@return {promise} distances {object, keys: word, distance} をresolve
@method analogy
@param positives {array} 正として処理したい単語{string}の配列
@param negatives {array} 負として処理したい単語{string}の配列
@param num {number} 取得する類似単語の数
@return {promise} analogies {array of words{string}} をresolve
@method distance
@param word {string} 単語
@param num {number} 取得する単語の数
@return {promise} distances {object, keys; word, distance} をresolve
@method similarity
@param word1 {string}
@param word2 {string}
@return {promise} similarity {number} をresolve
上記メソッドのwrapper
@method wakachi
@param text {string} 分かち書きしたい文章
@return {promise} surfaces {array of words{string}} を resolve
@method tendency b + c - aを評価 (aにおけるb に対する cにおけるx)
@param a {string}
@param b {string}
@param c {string}
@return {promise} mostAnalogWord {string} をresolve
@method word2vec
@params ...words {string}
@return {promise} vectors {array of vector} をresolve
@method vec2word
@params ...vecs {vector}
@return {promise} words {array of string} をresolve
Vector
@static
@method add
@params ...vecs {vector}
@return vecs {vector}
@static
@method sub
@param vec1 {vector}
@param vec2 {vector}
@return vec {vector} vec1 - vec2
@method normalize
@param {void}
@return vec {vector} 正規化
@method toString
@param {void}
@return str {string} join(',')