Joke Collection Website - Public benefit messages - Segmentation extraction of short messages
Segmentation extraction of short messages
Imported street fighter
Import jieba.posseg as pseg.
Import jieba.analyse
# jieba.load _ userdict ('userdict. txt') # jieba has a dict.txt thesaurus by default, but you can add your own entries according to your own needs.
Str 1 = "The common method to train networks that can be classified in n dimensions is to use polynomial logistic regression. “
Str2 = "You can try to modify the network architecture to accurately replicate the fully connected model."
Str3 = "The objective function of the model is to find the sum of cross entropy loss and all weight attenuation terms, and the return value of the loss () function is this value."
Seg _ list = jieba. cut(str 1, cut _ all = true)# full mode.
Print ("/". join(seg _ list))
result = pseg . cut(str 1)
Result 2 = jieba. cut(str 2)# exact mode
Result 3 = jieba.analyze.extract _ tags (str 3,4) # keyword extraction
Result4 = jieba.cut _ for _ search (str 3) # search engine mode
For w in the result:
Print (w.word, w.flag)
Print ("". Join (result 2))
Print ("". Join (result 3))
Print ("". Join (result 4))
- Previous article:What can I bring with me when I transfer to a dream zone?
- Next article:Samsung note3 SMS is sent regularly every day. How to cancel?
- Related articles
- How to open and use Huawei Situational Intelligence?
- Should I be isolated from Tianjin to Nancheng County, Fuzhou City, Jiangxi Province?
- Boyfriend is introverted, but very active. He calls me and sends messages every day, but I'm not used to contacting him actively. ...
- Wenzhou Bank passed the interview. Do you want to review?
- Does ABC's SMS reminder service not wake up if the transaction amount is small?
- What's a better way to meet at Hongqiao Railway Station?
- China Renmin University Law Postgraduate Scholarship System?
- My friend is doing part-time promotion, sending 3 messages a day, getting 30 yuan a day, just sending friends. So the question is, how does this company make a profit?
- If a girl clearly knows that a boy likes her very much, but she still replies to the text message in time every time, what does it mean?
- 30th birthday greetings