b731f24a9f6a2f5547ebd6e642004adeacbe18da,ข้อความ/build_pythainlp.py,,,#,14

Before Change


listneg=[e.strip() for e in lines]
f.close() // ปิดไฟล์
// neutral.txt
with codecs.open("neutral.txt", "r", "utf-8") as f:
    lines = f.readlines()
listneutral=[e.strip() for e in lines]
f.close() // ปิดไฟล์
print(1)
pos1=["pos"]*len(listpos)

After Change


print(2)
training_data = list(zip(listpos,pos1)) + list(zip(listneg,neg1))
print(3)
vocabulary = set(chain(*[(set(word_tokenize(i[0]))-set(stopwords.words("thai"))) for i in training_data]))
//vocabulary = set(chain(*[x for x in a if x not in [list(set(word_tokenize(i[0]))) for i in training_data]]))
print(3.1)
feature_set = [({i:(i in word_tokenize(sentence)) for i in vocabulary},tag) for sentence, tag in training_data]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: PyThaiNLP/lexicon-thai
Commit Name: b731f24a9f6a2f5547ebd6e642004adeacbe18da
Time: 2017-08-16
Author: wannaphong@yahoo.com
File Name: ข้อความ/build_pythainlp.py
Class Name:
Method Name:


Project Name: codelucas/newspaper
Commit Name: 6327d66fc29e242a8a47018d333c12b4b4bcfaf9
Time: 2017-10-21
Author: obulat@gmail.com
File Name: newspaper/nlp.py
Class Name:
Method Name:


Project Name: evilsocket/pwnagotchi
Commit Name: 02e6ccbd8ea2b33611993ca612688ddf45d3383e
Time: 2019-10-05
Author: evilsocket@gmail.com
File Name: sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/auto-update.py
Class Name:
Method Name: on_internet_available


Project Name: sobhe/hazm
Commit Name: 12779ec8b031b846f740f265f1e5139a4e93ce35
Time: 2017-09-26
Author: az.nourian@gmail.com
File Name: hazm/WordTokenizer.py
Class Name: WordTokenizer
Method Name: __init__