Example #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()
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
Example #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()
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
Example #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()
Example #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()