Opinion Analysis Toolkit
A toolkit to extract opinions and useful information from text
Installation
pip install opinionx
Example Usage
- Find opinions
from opinionx.text import get_opinion
text=open("test.txt",'r',encoding='utf-8').read()
opinion_words=['表示','认为','说','介绍','提出','透露','指出','强调',':']
list_opinion,_,_=get_opinion(text,lang='zh',opinion_words=opinion_words)
for opinion in list_opinion:
print(opinion)
- Find Leader's Opinions
from opinionx.text import get_leader_opinions
text=open("test.txt",'r',encoding='utf-8').read()
list_opinion = get_leader_opinions(text,save_path="", search_keywords_path="data/search_keywords.csv",leader_path="data/g20_leaders.csv")
print()
for opinion in list_opinion:
print(opinion)
print(opinion["opinion"])
print(opinion["first_found_keyword"])
print(opinion["first_found_leader"])
print()
- run tf-idf and tf models for massive text files
from opinionx.tfidf_shell import *
run_tfidf_shell(input_folder="tfidf_folder/raw_data", # a list of text files
output_folder="tfidf_folder/output", # output folder
user_dict_path="tfidf_folder/user_dictionaries", # the folder contains csv files with each line as a word
font_path="utils/fonts/SimHei.ttf",# use it when analysis Chinese text
is_html=True
)
Credits & References
License
The opinionx project is provided by Donghua Chen.
Metadata
Release files for opinionx 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opinionx-0.0.2.tar.gz | 32.5 kB | Without provenance | Details for opinionx-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opinionx-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for opinionx-0.0.2-py3-none-any.whl |
Total release size: 65.9 kB
Release files / opinionx-0.0.2.tar.gz
| Download URL | opinionx-0.0.2.tar.gz |
|---|---|
| Size | 32.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44123163a2364fd459d496603cec64ce4c2bede87adbe263808dab997b236c21
|
|
BLAKE2b-256 checksum How to use checksums |
4b4669fa1d446c82fcc9769242aa94b2059eb3dd07cc9f3b010b2151cd20e5c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11
|
Release files / opinionx-0.0.2-py3-none-any.whl
| Download URL | opinionx-0.0.2-py3-none-any.whl |
|---|---|
| Size | 33.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23056b2468b7a8599d69d76f53541c44ba2190f801c6b5eedbe3daae86cb657c
|
|
BLAKE2b-256 checksum How to use checksums |
6901d26a958fed16c023f7d8e94245f4d2aa07918c12cbcf0fa12d232aaaf06f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11
|
Security for opinionx 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.