hadoopСW
`
`
  • ע2018-09-13
  • l160
  • QQ3234520070
  • 360ö
  • ۽z0
  • 0
x3948؏ͣ0

美国和中国的足球 :Hanlp-Re{ԇԔ

#
lڣ2019-07-29 10:54
hanlp~؄enjw^؄e`Re߅eׂ`ReҪָ߅ęCReҲԵReAReʴ_Ҳ™CReʴ_

www.dhkyo.com DƬ.jpg


1 +
[1] LIWs܇10΁71v
[2] ÿճɽ512պƷNۂ䰸43
[3] Vҕg-ShԺL99հɫҊ
2 ǰ~+~~β~+~~
[1] 4000ԪYஔ˽X
[2] ·ݏİ^ɽ|ʮ{·]
[3] ܿ˚gӭij󿼸УڵijІ
3 ~
[1] ε˾Cӿʡrӆ ˿Ͱ·ĵδ
[2] “ɽˮSΌ“
[3] “yeˮΌ“
Badcase
߅BһŲ`ԭԼķ
Ҫ_Žcע
1.wRe~Ӱ
2.wReͬ漰Ć}
3.HanLPһЩҊČw~e`
4.HanLP[RwRٻʛ]؄eҪԒҪȥӖ
@҂߅@badcaseķ^̞f
[5] “ɽˮSΌ“
_ʾģʽ HanLP.Config.enableDebug()
\Rea
# HanLPwRe
def hanlp_ner(text, ner_type):
   global segment
   ner_li = []
   for term in segment.seg(text):
       if str(term.nature) == ner_type:
           ner_li.append(str(term.word))
return ner_li
@ner_typeҪReČwtner_type='nr'ner_type='ns'Cner_type='nt'textҪȡwı
ReY@ֻȡ˲ݔ
ַֽY[“/n, /w, ɽˮ/n, /d, S/ns, /rr, /a, /w, /ryv, /p, “/n, /w]
ɫ^죺[  S 1163565 ][“ Z 20211628 ][ A 2701 B 439 X 11 ][ɽˮ B 6 A 1 ][ B 214 A 3 C 3 ][S G 1 H 1 ]
[ A 47 B 26 ][ C 274 A 75 B 66 D 2 X 2 ][ A 40525 B 10497 X 418 ][ B 44 ][ A 2896 B 454 X 215 ][“ Z 20211628 ][ B 82 ][  B 1322 ]
ɫע[ /S ,“/Z ,/B ,ɽˮ/A ,/C ,S/H ,/B ,/B ,/A ,/B ,/A ,“/Z ,/B , /S]
ReS CH
hanlp_ns ['S']
@ȻSJǵҴַֽYʾδRe?ΈʺʹІTעĽ?@Ȼ@~팧µڛ]н^Re??ԲҪȥİl~ns.txtȥ~ZֻҪ~CoreNatureDictionary.txtȥ

DƬD1.jpg


@Ȼں~SӛһѡS~Єhh~ļCoreNatureDictionary.txt.bin֮ٴ\гõ߅ݔY
hanlp_ns []
@҂ҲԿһЩҊɵ~Ќe`Rew҂ԓһuyZÿ޸ˌw~ҪһœyԇZϲ鿴ʴ_͵̫tʾ@ӼMDzеͬrӵČwҲпܕɷ~e`
߅fһHanLPPw~ļ
1.CoreNatureDictionary.mini.txt
2.CoreNatureDictionary.txt
3.CustomDictionary.txt
4.C~.txt
5.ȫȫ.txt
6.~.txt
7.Ϻ.txt
8.FhZa~.txt
9.ns.txt
10.nr.txt
11.nt.txt
Ȼ@гͨп܌`Re~@Щ~]ҵ߀ҪHanLP~ļЌ
ϣă݌ʹHanLP[RЪ犵СЎ@һcСwwRe䌍~ܲɷֵ߶йͬ̎yc~x磨߅Ĵ_~䌍NLPă֮һ~CW䌍]̫Pϵ߅badcaseQǸֱȥijЩ~һЩƧwRe҂ǷԿ]Ϣ֮ĜyȺQ@N~ǷҪ_cǰ󘋳~ᘌ~]ʹȌWķ˽@ЩҲDZ횵mȻڌHNDz͵жȥW

ϲg0 u0
DKHadoop߀e
؏
ο