Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cn-sentiment-measures

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cn-sentiment-measures

A toolkit for estimating Chinese sentiment scores with multiple measures.

  • 1.0.0.dev5
  • Source
  • PyPI
  • Socket score

Maintainers
1

Chinese Sentiment Measures

A toolkit for estimating Chinese sentiment scores with multiple measures.

pip install cn-sentiment-measures

Measures

  1. Absolute Proportional Difference - APD. Bounds: [-1, 1]
  2. Relative Proportional Difference - RPD. Bounds: [-1, 1]
  3. Logit scale - LC. Bounds: [-infinity, +infinity]

Improved versions of the above measures by integrating degree words are marked with _with_degree in the toolkit.

Examples


from cn_sentiment_measures.sentiment_measures import SentimentMeasures

sm = SentimentMeasures()

word_list=["我","今天","很","高兴"]

print("Here are measure values with normal measures!")
print('APD = ',sm.APD(word_list))
print('RPD = ',sm.RPD(word_list))
print('LS = ',sm.LS(word_list))

print()
print("Here are measure values optimized by using adverb words!")
print('APD* = ',sm.APD_with_degree(word_list))
print('RPD* = ',sm.RPD_with_degree(word_list))
print('LS* = ',sm.LS_with_degree(word_list))

License

The project is provided by Donghua Chen.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc