Exemple #1
0
 def tag_comments_test(self, comments):
     comments = utils.remove_punctuation(comments)
     phrase_tag = set()
     phrase_list = comments.split(' ')
     for p in phrase_list:
         for t in self.tags_repo:
             match_part, if_same = wordvec.compare_phrase(p.strip(), t.strip(),self.model)
             if if_same:
                 phrase_tag.add((p.strip(),t.strip()))
     return phrase_tag
Exemple #2
0
 def tag_comments_database(self, comments):
     comments = utils.remove_punctuation(comments)
     print comments
     phrase_tag = set()
     phrase_list = comments.split(' ')
     for p in phrase_list:
         for t in self.tags_repo:
             match_part, if_same = wordvec.compare_phrase(p, t, self.model)
             if if_same:
                 phrase_tag.add(t)
     return phrase_tag
Exemple #3
0
 def tag_comments_test(self, comments):
     comments = utils.remove_punctuation(comments)
     phrase_tag = set()
     phrase_list = comments.split(' ')
     for p in phrase_list:
         for t in self.tags_repo:
             match_part, if_same = wordvec.compare_phrase(
                 p.strip(), t.strip(), self.model)
             if if_same:
                 phrase_tag.add((p.strip(), t.strip()))
     return phrase_tag
Exemple #4
0
 def tag_comments_database(self, comments):
     comments = utils.remove_punctuation(comments)
     print comments
     phrase_tag = set()
     phrase_list = comments.split(' ')
     for p in phrase_list:
         for t in self.tags_repo:
             match_part, if_same = wordvec.compare_phrase(p, t,self.model)
             if if_same:
                 phrase_tag.add(t)
     return phrase_tag