protected function evaluateDimension($text) { $mecab = mecab($text); $mecab = $this->keywords->addKeywordIntoMecabInfo($mecab, array('動詞', '名詞', '形容詞', '形容動詞')); $img = new IpcaImage(); $img->load_mecab($mecab); $img->mul($this->filter); $this->ipca->project($img->data, $vec); return $vec; }
public function evaluateLikelihood($text) { $mecab = mecab($text); $mecab = $this->keywords->addKeywordIntoMecabInfo($mecab, array('動詞', '名詞', '形容詞', '形容動詞')); $img = new IpcaImage(); $img->load_mecab($mecab); $img->mul($this->filter); $res = new IpcaImage(); $this->ipca->reflectProject($img->data, $res->data, $this->target); return $res->data[$this->target]; }
function score($info) { $img = new IpcaImage(); $img->load_mecab($info['mecab']); $img->mul($this->filter); $res = new IpcaImage(); $this->ipca->reflectProject($img->data, $res->data, $this->target); $score = $res->data[$this->target]; unset($info['mecab']); unset($info['user_screen_name']); unset($info['user_id']); $tid = $info['id']; if (!$tid) { $tid = $this->tcount++; } $this->infos[$tid] = $info; $this->scores[$tid] = $score; }