Esempio n. 1
0
 def simpleprocess(self):
     data = open(self.dataset_path, "r")
     for d in data.readlines():
         item = d.strip().split("\t")
         self.dataset.append(nlpir.segWithTag(item[0]).replace("\t", " "))
         self.label.append(item[1])
     data.close()
Esempio n. 2
0
def content_cut(content):
    #l_words = list(jieba.cut(content))
    str_words = nlpir.segWithTag(str(content))  #return string
    #str_words = nlpir.seg(content)   ## word with nature
    #str_words = str_words.replace('/','')
    #prt_debug_msg2(str_words)
    return str_words
Esempio n. 3
0
 def simpleprocess(self):
     data = open(self.dataset_path, "r")
     for d in data.readlines():
         item = d.strip().split("\t")
         self.dataset.append(nlpir.segWithTag(item[0]).replace("\t", " "))
         self.label.append(item[1])
     data.close()
Esempio n. 4
0
def content_cut(content):
    #l_words = list(jieba.cut(content))
    str_words = nlpir.segWithTag(str(content))  #return string
    #str_words = nlpir.seg(content)   ## word with nature
    #str_words = str_words.replace('/','')
    #prt_debug_msg2(str_words)
    return str_words
Esempio n. 5
0
 def simpleprocessone(self):
     data = open(self.dataset_path, "r")
     for d in data.readlines():
         item = d.strip("\n").split("#$|_$_|$#")
         if len(item) == 3:
             self.dataset.append(nlpir.segWithTag(item[2]).replace("\t", " "))
             self.label.append(item[0])
     data.close()
Esempio n. 6
0
 def simpleprocessone(self):
     data = open(self.dataset_path, "r")
     for d in data.readlines():
         item = d.strip("\n").split("#$|_$_|$#")
         if len(item) == 3:
             self.dataset.append(
                 nlpir.segWithTag(item[2]).replace("\t", " "))
             self.label.append(item[0])
     data.close()