Skip to main content

Sentic

Python Interface for Semantic and Sentiment Analysis using SenticNet 9 (https://sentic.net/).

Install

Using pip:

$ pip install sentic

Using the repository code:

$ python setup.py install

How to use

from sentic import SenticPhrase
text = "Shirley is such a cute girl."
sp = SenticPhrase(text)
sp.info(text)
>>> {'sentics': {'pleasantness': 0.0, 'attention': 0.0, 'sensitivity': 0.995, 'aptitude': 0.0}, 'moodtags': {'#delight': 1}, 'sentiment': 'strong positive', 'polarity': 0.995, 'semantics': {'aww', 'adore', 'petite', 'beaut', 'kute'}}

>>> sp.get_sentics(text)
{'pleasantness': 0.0, 'attention': 0.0, 'sensitivity': 0.995, 'aptitude': 0.0}

>>> sp.get_moodtags(text)
{'#delight': 1}

>>> sp.get_sentiment(text)
'strong positive'

>>> sp.get_polarity(text)
0.995

>>> sp.get_semantics(text)
{'aww', 'adore', 'petite', 'beaut', 'kute'}

Additionally, if you want to, you can just use the same SenticPhrase class object to make method calls on other bodies of text. This manner of functionality was introduced because creating new objects for every different body of text could be cumbersome and memory-inefficient.

# Word not in Sentic word set
>>> sp.info("asdkfjalsfknqsf")
{'sentics': {}, 'moodtags': {}, 'sentiment': 'neutral', 'polarity': 0, 'semantics': set()}

>>> sp.info("Humans are such an interesting species.")
{'sentics': {'pleasantness': 0.0, 'attention': 0.0, 'sensitivity': 0.659, 'aptitude': 0.0}, 'moodtags': {'#pleasantness': 1}, 'sentiment': 'strong positive', 'polarity': 0.659, 'semantics': {'plot_twist', 'food_for_thought', 'fond', 'appreciate', 'get_eyeball'}}

>>> sp.get_polarity("Use same object to get polarity on another text")
0.953

Also, you can use other languages:

from sentic import SenticPhrase
text = 'amour'
sp = SenticPhrase(text, "fr")
sp.get_semantics()
>>> [‘ramjet’, ‘economiste_hellenique’, ‘armuriere’, ‘job_explore’, ‘rayonnant’]

sp.get_moodtags()
>>> [‘#joy’, ‘#pleasantness’]

sp.get_sentics()
>>> {‘pleasantness’: 0.659, ‘attention’: 0, ‘sensitivity’: 0.659, ‘aptitude’: 0}

(In SenticNet 9, mood tags are standardized in English across all languages, and every language now carries polarity labels.)

sp.get_polarity()
>>> 0.659

sp.get_sentiment()
>>> strong positive

You can find all supported languages here: http://sentic.net/api/

About Senticnet

This framework was adapted from Yuri Malheiros (@yurimalheiros) https://github.com/yurimalheiros/senticnetapi.

SenticNet is an initiative conceived at the MIT Media Laboratory in 2010 within an industrial Cooperative Awards in Science and Engineering (CASE) research project, funded by the UK Engineering and Physical Sciences Research Council (EPSRC) and born from the collaboration between the University of Stirling, the Media Lab, and Sitekit Labs.

Currently, both the SenticNet knowledge base and the SenticNet framework are being maintained and further developed by the Sentic Team, a multidisciplinary research group based at the School of Computer Engineering of Nanyang Technological University in Singapore, but also by many other sentic enthusiasts around the world.

Please acknowledge the authors by citing SenticNet 9 in any research work or presentation containing results obtained in whole or in part through the use of the API:

E Cambria, R Mao, X Zhang, L Xiao, T Shen, A Anand. SenticNet 9: Generative Commonsense for Emotion AI via Conceptual Primitive Discovery and Time Shift Mechanism. IEEE Transactions on Computational Social Systems 13 (2026)

License

Copyright © 2026 SenticNet.

This software is provided for non-commercial use only. Commercial use — including selling, licensing, sublicensing, offering paid services, or integrating the Software into commercial products or services — is permitted only for users who hold an active Sentic Membership, or who obtain prior written permission from the copyright holder. See the LICENSE file for the full terms.

Release files for sentic 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sentic 0.0.9
File Size Uploaded
sentic-0.0.9.tar.gz 58.4 MB Details

Release files / sentic-0.0.9.tar.gz

Download URL sentic-0.0.9.tar.gz
Size 58.4 MB
Tags Source
SHA-256 checksum
How to use checksums
fc4f2c5141b5864e933cf03420b3c0f005879477a8c67ef111ab6356f41bd712
BLAKE2b-256 checksum
How to use checksums
f3569f09e2f70b04365559e3f8e03d761ab735954a12f19cc381333c4cb14776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.0.9 This release

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page