fa45d8aa5f
- health_checklist.json: 192.168.1.122→node122
- ocr_client.py: docstring IP→node122
- docs/market-data-requirements.md: IP→node122
- 所有API调用通过ProxyHandler({})绕过系统代理
Privoxy对node122:18003返回500,直连正常
42 lines
1010 B
Plaintext
42 lines
1010 B
Plaintext
.. Copyright (C) 2001-2026 NLTK Project
|
|
.. For license information, see LICENSE.TXT
|
|
|
|
======================
|
|
SentiWordNet Interface
|
|
======================
|
|
|
|
SentiWordNet can be imported like this:
|
|
|
|
>>> from nltk.corpus import sentiwordnet as swn
|
|
|
|
------------
|
|
SentiSynsets
|
|
------------
|
|
|
|
>>> breakdown = swn.senti_synset('breakdown.n.03')
|
|
>>> print(breakdown)
|
|
<breakdown.n.03: PosScore=0.0 NegScore=0.25>
|
|
>>> breakdown.pos_score()
|
|
0.0
|
|
>>> breakdown.neg_score()
|
|
0.25
|
|
>>> breakdown.obj_score()
|
|
0.75
|
|
|
|
|
|
------
|
|
Lookup
|
|
------
|
|
|
|
>>> list(swn.senti_synsets('slow'))
|
|
[SentiSynset('decelerate.v.01'), SentiSynset('slow.v.02'),
|
|
SentiSynset('slow.v.03'), SentiSynset('slow.a.01'),
|
|
SentiSynset('slow.a.02'), SentiSynset('dense.s.04'),
|
|
SentiSynset('slow.a.04'), SentiSynset('boring.s.01'),
|
|
SentiSynset('dull.s.08'), SentiSynset('slowly.r.01'),
|
|
SentiSynset('behind.r.03')]
|
|
|
|
>>> happy = swn.senti_synsets('happy', 'a')
|
|
|
|
>>> all = swn.all_senti_synsets()
|