zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
U
¡ý°do=ã@s|dZddlZddlZddlZddlZddlmZddlmZddlmZddlm    Z    ddlm
Z
ddl Z Gd    d
„d
eƒZ dS) u
自然语言处理
éNé)ÚAipBase)Úbase64)Újson)Ú    urlencode)Úquotec@sîeZdZdZdZdZdZdZdZdZ    dZ
d    Z d
Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#d$„Z%d%d&„Z&djd(d)„Z'dkd*d+„Z(dld,d-„Z)dmd.d/„Z*dnd0d1„Z+dod2d3„Z,dpd4d5„Z-dqd6d7„Z.drd8d9„Z/dsd:d;„Z0dtd<d=„Z1dud>d?„Z2dvd@dA„Z3dwdBdC„Z4dxdDdE„Z5dydFdG„Z6dzdHdI„Z7d{dJdK„Z8d|dLdM„Z9d}dNdO„Z:d~dPdQ„Z;ddRdS„Z<d€dTdU„Z=ddVdW„Z>d‚dXdY„Z?dƒdZd[„Z@d„d\d]„ZAd…d^d_„ZBd†d`da„ZCd‡dbdc„ZDdˆddde„ZEd‰dfdg„ZFdŠdhdi„ZGd'S)‹ÚAipNlpu
    è‡ªç„¶è¯­è¨€å¤„理
    z-https://aip.baidubce.com/rpc/2.0/nlp/v1/lexerz4https://aip.baidubce.com/rpc/2.0/nlp/v1/lexer_customz?https://aip.baidubce.com/rpc/2.0/nlp/v2/depparser?charset=UTF-8z4https://aip.baidubce.com/rpc/2.0/nlp/v2/word_emb_vecz0https://aip.baidubce.com/rpc/2.0/nlp/v2/dnnlm_cnz4https://aip.baidubce.com/rpc/2.0/nlp/v2/word_emb_simz.https://aip.baidubce.com/rpc/2.0/nlp/v2/simnetz3https://aip.baidubce.com/rpc/2.0/nlp/v2/comment_tagz:https://aip.baidubce.com/rpc/2.0/nlp/v1/sentiment_classifyz/https://aip.baidubce.com/rpc/2.0/nlp/v1/keywordz;https://aip.baidubce.com/rpc/2.0/nlp/v1/topic?charset=UTF-8z-https://aip.baidubce.com/rpc/2.0/nlp/v1/ecnetz/https://aip.baidubce.com/rpc/2.0/nlp/v1/emotionz4https://aip.baidubce.com/rpc/2.0/nlp/v1/news_summaryz/https://aip.baidubce.com/rpc/2.0/nlp/v1/addressz:https://aip.baidubce.com/rpc/2.0/nlp/v2/comment_tag_customzAhttps://aip.baidubce.com/rpc/2.0/nlp/v1/sentiment_classify_customz5https://aip.baidubce.com/rpc/2.0/creation/v1/coupletsz1https://aip.baidubce.com/rpc/2.0/creation/v1/poemz>https://aip.baidubce.com/rpc/2.0/nlp/v1/entity_level_sentimentzBhttps://aip.baidubce.com/rpc/2.0/nlp/v1/entity_level_sentiment/addzEhttps://aip.baidubce.com/rpc/2.0/nlp/v1/entity_level_sentiment/deletezJhttps://aip.baidubce.com/rpc/2.0/nlp/v1/entity_level_sentiment/delete_repozChttps://aip.baidubce.com/rpc/2.0/nlp/v1/entity_level_sentiment/listzDhttps://aip.baidubce.com/rpc/2.0/nlp/v1/entity_level_sentiment/queryz9https://aip.baidubce.com/rpc/2.0/creation/v1/topic_phrasez8https://aip.baidubce.com/rpc/2.0/recruitment/v1/cvparserz;https://aip.baidubce.com/rpc/2.0/recruitment/v1/person_postz8https://aip.baidubce.com/rpc/2.0/recruitment/v1/personasz6https://aip.baidubce.com/rpc/2.0/nlp/v1/titlepredictorz1https://aip.baidubce.com/rpc/2.0/nlp/v2/depparserz6https://aip.baidubce.com/rpc/2.0/nlp/v1/bless_creationz7https://aip.baidubce.com/rpc/2.0/nlp/v1/entity_analysiscCs˜tjjdkrXt |¡ d¡dkr<t | dd¡     d¡¡p:iSt | dd¡     d¡¡pViSt |¡ d¡dkr€t t
|dƒ¡p~iSt t
|dƒ¡p’iSdS)z$
            formate result
        éÚencodingzutf-8Úutf8ÚignoreÚgbkN) ÚsysÚ version_infoÚmajorÚchardetÚdetectÚgetrÚloadsÚdecodeÚencodeÚstr)ÚselfÚcontent©rú>d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\aip/nlp.pyÚ_proccessResultJs zAipNlp._proccessResultcCsrtjjdkr>d|kr"tj|ddStj|dd d¡ dd¡Sd|krZtj|dd d¡Stj|dd d¡SdS)    z&
            _proccessRequest
        r    zUTF-8F)Ú ensure_asciir r r N)rrrrÚdumpsrr)rÚurlÚparamsÚdataÚheadersrrrÚ_proccessRequestXs zAipNlp._proccessRequestNcCs,|pi}i}||d<| |¡| |j|¡S)u"
            è¯æ³•分析
        Útext)ÚupdateÚ_requestÚ_AipNlp__lexerUrl©rr$Úoptionsr!rrrÚlexerfs
 
z AipNlp.lexercCs,|pi}i}||d<| |¡| |j|¡S)u1
            è¯æ³•分析(定制版)
        r$)r%r&Ú_AipNlp__lexerCustomUrlr(rrrÚ lexerCustomss
 
zAipNlp.lexerCustomcCs2|pi}i}||d<| |¡| |j|ddi¡S)u(
            ä¾å­˜å¥æ³•分析
        r$z Content-Typezapplication/json;charset=utf-8)r%r&Ú_AipNlp__depParserUrlr(rrrÚ    depParser€s
 
ÿzAipNlp.depParsercCs,|pi}i}||d<| |¡| |j|¡S)u%
            è¯å‘量表示
        Úword)r%r&Ú_AipNlp__wordEmbeddingUrl)rr/r)r!rrrÚ wordEmbeddingŽs
 
zAipNlp.wordEmbeddingcCs,|pi}i}||d<| |¡| |j|¡S)u%
            DNN语言模型
        r$)r%r&Ú_AipNlp__dnnlmCnUrlr(rrrÚdnnlm›s
 
z AipNlp.dnnlmcCs4|pi}i}||d<||d<| |¡| |j|¡S)u%
            è¯ä¹‰ç›¸ä¼¼åº¦
        Úword_1Úword_2)r%r&Ú_AipNlp__wordSimEmbeddingUrl)rr4r5r)r!rrrÚwordSimEmbedding¨s 
zAipNlp.wordSimEmbeddingcCs4|pi}i}||d<||d<| |¡| |j|¡S)u(
            çŸ­æ–‡æœ¬ç›¸ä¼¼åº¦
        Útext_1Útext_2)r%r&Ú_AipNlp__simnetUrl)rr8r9r)r!rrrÚsimnet¶s 
z AipNlp.simnetcCs,|pi}i}||d<| |¡| |j|¡S)u(
            è¯„论观点抽取
        r$)r%r&Ú_AipNlp__commentTagUrlr(rrrÚ
commentTagÄs
 
zAipNlp.commentTagcCs,|pi}i}||d<| |¡| |j|¡S)u(
            æƒ…感倾向分析
        r$)r%r&Ú_AipNlp__sentimentClassifyUrlr(rrrÚsentimentClassifyÑs
 
zAipNlp.sentimentClassifycCs4|pi}i}||d<||d<| |¡| |j|¡S)u"
            æ–‡ç« æ ‡ç­¾
        Útitler)r%r&Ú_AipNlp__keywordUrl©rr@rr)r!rrrÚkeywordÞs 
zAipNlp.keywordcCs4|pi}i}||d<||d<| |¡| |j|¡S)u"
            æ–‡ç« åˆ†ç±»
        r@r)r%r&Ú_AipNlp__topicUrlrBrrrÚtopicìs 
z AipNlp.topiccCs,|pi}i}||d<| |¡| |j|¡S)u"
            æ–‡æœ¬çº é”™
        r$)r%r&Ú_AipNlp__ecnetUrlr(rrrÚecnetús
 
z AipNlp.ecnetcCs,|pi}i}||d<| |¡| |j|¡S)u.
            å¯¹è¯æƒ…绪识别接口
        r$)r%r&Ú_AipNlp__emotionUrlr(rrrÚemotions
 
zAipNlp.emotioncCs4|pi}i}||d<||d<| |¡| |j|¡S)u(
            æ–°é—»æ‘˜è¦æŽ¥å£
        rÚmax_summary_len)r%r&Ú_AipNlp__newsSummaryUrl)rrrJr)r!rrrÚ newsSummarys 
zAipNlp.newsSummarycCs,|pi}i}||d<| |¡| |j|¡S)u(
            åœ°å€è¯†åˆ«æŽ¥å£
        r$)r%r&Ú_AipNlp__addressUrlr(rrrÚaddress"s
 
zAipNlp.addresscCs,|pi}i}||d<| |¡| |j|¡S)u~
            è¯„论观点抽取(定制)
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/ok6z52g8q
        r$)r%r&Ú_AipNlp__commentTagCustomUrlr(rrrÚcommentTagCustom/s
 
zAipNlp.commentTagCustomcCs,|pi}i}||d<| |¡| |j|¡S)u~
            æƒ…感倾向分析(定制)
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/zk6z52hds
        r$)r%r&Ú#_AipNlp__sentimentClassifyCustomUrlr(rrrÚsentimentClassifyCustom=s
 
zAipNlp.sentimentClassifyCustomcCs,|pi}i}||d<| |¡| |j|¡S)ul
            æ™ºèƒ½æ˜¥è”
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Ok53wb6dh
        r$)r%r&Ú_AipNlp__coupletsUrlr(rrrÚcoupletsKs
 
zAipNlp.coupletscCs,|pi}i}||d<| |¡| |j|¡S)ul
            æ™ºèƒ½å†™è¯—
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/ak53wc3o3
        r$)r%r&Ú_AipNlp__poemUrlr(rrrÚpoemYs
 
z AipNlp.poemcCs<|pi}i}||d<||d<||d<| |¡| |j|¡S)u
            å®žä½“抽取与情感倾向分析
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Fk6z52g04
        r@rÚtype)r%r&Ú _AipNlp__entityLevelSentimentUrl)rr@rrWr)r!rrrÚentityLevelSentimentgs
zAipNlp.entityLevelSentimentcCs4|pi}i}||d<||d<| |¡| |j|¡S)u¼
            å¢žåŠ å®žä½“/实体库新增
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Fk6z52g04#%E5%AE%9E%E4%BD%93%E5%BA%93%E6%96%B0%E5%A2%9E%E6%8E%A5%E5%8F%A3
        Ú
repositoryÚentities)r%r&Ú#_AipNlp__entityLevelSentimentAddUrl©rrZr[r)r!rrrÚentityLevelSentimentAddws 
zAipNlp.entityLevelSentimentAddcCs4|pi}i}||d<||d<| |¡| |j|¡S)uÈ
            åˆ é™¤å®žä½“/实体名单删除
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Fk6z52g04#%E5%AE%9E%E4%BD%93%E5%90%8D%E5%8D%95%E5%88%A0%E9%99%A4%E6%8E%A5%E5%8F%A3
        rZr[)r%r&Ú&_AipNlp__entityLevelSentimentDeleteUrlr]rrrÚentityLevelSentimentDelete†s 
z!AipNlp.entityLevelSentimentDeletecCs,|pi}i}||d<| |¡| |j|¡S)u¿
            åˆ é™¤å®žä½“库/实体库删除
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Fk6z52g04#%E5%AE%9E%E4%BD%93%E5%BA%93%E5%88%A0%E9%99%A4%E6%8E%A5%E5%8F%A3
        Ú repositories)r%r&Ú*_AipNlp__entityLevelSentimentDeleteRepoUrl)rrar)r!rrrÚentityLevelSentimentDeleteRepo•s
 
z%AipNlp.entityLevelSentimentDeleteRepocCs$|pi}i}| |¡| |j|¡S)u¿
            å®žä½“库列表/实体库查询
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Fk6z52g04#%E5%AE%9E%E4%BD%93%E5%BA%93%E6%9F%A5%E8%AF%A2%E6%8E%A5%E5%8F%A3
        )r%r&Ú$_AipNlp__entityLevelSentimentListUrl)rr)r!rrrÚentityLevelSentimentList£s
zAipNlp.entityLevelSentimentListcCs,|pi}i}||d<| |¡| |j|¡S)uÈ
            æŸ¥è¯¢å®žä½“/实体名单查询
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Fk6z52g04#%E5%AE%9E%E4%BD%93%E5%90%8D%E5%8D%95%E6%9F%A5%E8%AF%A2%E6%8E%A5%E5%8F%A3
        rZ)r%r&Ú%_AipNlp__entityLevelSentimentQueryUrl)rrZr)r!rrrÚentityLevelSentimentQuery®s
 
z AipNlp.entityLevelSentimentQuerycCs4|pi}i}||d<||d<| |¡| |j|¡S)ux
            æ–‡ç« ä¸»é¢˜çŸ­è¯­ç”Ÿæˆ
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/9k53w3qob
        r@Úsummary)r%r&Ú_AipNlp__topicPhraseUrl)rr@rhr)r!rrrÚ topicPhrase¼s 
zAipNlp.topicPhrasecCs,|pi}i}||d<| |¡| |j|¡S)uy
            æ™ºèƒ½æ‹›è˜-简历解析
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Xkahvfeqa
        Úresume)r%r&Ú_AipNlp__cvparserUrl©rrkr)r!rrrÚrecruitmentCvparserËs
 
zAipNlp.recruitmentCvparsercCs4|pi}i}||d<||d<| |¡| |j|¡S)uy
            æ™ºèƒ½æ‹›è˜-人岗匹配
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/Pkahwzux5
        rkÚjob_description)r%r&Ú_AipNlp__personPostUrl)rrkror)r!rrrÚrecruitmentPersonPostÙs 
zAipNlp.recruitmentPersonPostcCs,|pi}i}||d<| |¡| |j|¡S)uy
            æ™ºèƒ½æ‹›è˜-简历画像
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/5kc1kmz3w
        rk)r%r&Ú_AipNlp__personasUrlrmrrrÚrecruitmentPersonasès
 
zAipNlp.recruitmentPersonascCs,|pi}i}||d<| |¡| |j|¡S)ur
            æ–‡ç« æ ‡é¢˜ç”Ÿæˆ
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/0kvc1u1eg
        Údoc)r%r&Ú_AipNlp__titlepredictorUrl)rrtr)r!rrrÚtitlepredictorös
 
zAipNlp.titlepredictorcCs,|pi}i}||d<| |¡| |j|¡S)ut
            ä¾å­˜å¥æ³•分析V2
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/nk6z52eu6
        r$)r%r&Ú_AipNlp__depparserV2Urlr(rrrÚ depParserV2s
 
zAipNlp.depParserV2cCs,|pi}i}||d<| |¡| |j|¡S)uo
            ç¥ç¦è¯­ç”Ÿæˆ
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/sl4cg75jk
        r$)r%r&Ú_AipNlp__blessCreationUrlr(rrrÚ blessCreations
 
zAipNlp.blessCreationcCs,|pi}i}||d<| |¡| |j|¡S)ul
            å®žä½“分析
            æŽ¥å£æ–‡æ¡£é“¾æŽ¥: https://ai.baidu.com/ai-doc/NLP/al631z295
        r$)r%r&Ú_AipNlp__entityAnalysisUrlr(rrrÚentityAnalysis s
 
zAipNlp.entityAnalysis)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)HÚ__name__Ú
__module__Ú __qualname__Ú__doc__r'r+r-r0r2r6r:r<r>rArDrFrHrKrMrOrQrSrUrXr\r_rbrdrfrirlrprrrurwryr{rr#r*r,r.r1r3r7r;r=r?rCrErGrIrLrNrPrRrTrVrYr^r`rcrergrjrnrqrsrvrxrzr|rrrrrsŠ
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
r) r€ÚrerÚmathÚtimeÚbaserrrrrrrrrrrÚ<module>s