def test_recognition_2_level(self): person_recognition.recognition(self.vertexs, self.word_net_optimum, self.word_net) place_recognition.recognition(self.vertexs, self.word_net_optimum, self.word_net) word_net_optimum = WordNet(self.text, vertexs=self.vertexs) vertexs = organization_recognition.recognition(self.vertexs, word_net_optimum, self.word_net) # viterbi(word_net_optimum.vertexs) dump_vertexs(vertexs) self.assertIn(Vertex(u"济南杨铭宇餐饮管理有限公司", attribute=u"nt 1"), vertexs)
def test_organization_recognition(self): text = traditional_to_simplified(u"馬總統上午前往陸軍航空601旅,") Config.debug = True self.gen_word(text) person_recognition.recognition(self.vertexs, self.word_net_optimum, self.word_net) place_recognition.recognition(self.vertexs, self.word_net_optimum, self.word_net) word_net_optimum = WordNet(self.text, vertexs=self.vertexs) vertexs = organization_recognition.recognition(self.vertexs, word_net_optimum, self.word_net) dump_vertexs(vertexs) self.assertIn(Vertex(u"陆军航空601旅", attribute=u"nt 1"), vertexs)
def test_recognition_2_level(self): text = u"济南杨铭宇餐饮管理有限公司是由杨先生创办的餐饮企业" self.gen_word(text) person_recognition.recognition(self.vertexs, self.word_net_optimum, self.word_net) place_recognition.recognition(self.vertexs, self.word_net_optimum, self.word_net) word_net_optimum = WordNet(self.text, vertexs=self.vertexs) vertexs = organization_recognition.recognition(self.vertexs, word_net_optimum, self.word_net) # viterbi(word_net_optimum.vertexs) dump_vertexs(vertexs) self.assertIn(Vertex(u"济南杨铭宇餐饮管理有限公司", attribute=u"nt 1"), vertexs)