Easy-to-use, high-quality identification of generic framing dimensions in English news articles
Project description
NewsFrames
A single-label classifier for universal framing dimensions in news articles on political topics.
Setup
Create python environment, for example with conda. Python 3.8 or later is supported.
conda create --yes -n NewsFrames python=3.8
conda activate NewsFrames
Install:
pip install NewsFrames
Usage
from NewsFrames import Classifier
classifier = Classifier()
results = classifier.predict(["Executives at the British software company Autonomy mischaracterised revenues from clients including Tottenham Hotspur, the Serious Fraud Office and the BBC to inflate software sales figures before a disastrous £8bn acquisition by the US firm Hewlett-Packard, London’s high court has heard."])
print(results)
You can use the attribute_mode
parameter to get predictions for the individual
attributes (attribute_mode="withattributes"
) or only whether the respective dimension
is present or not (attribute_mode="withoutattributes"
). The default is
withattributes
.
classifier = Classifier(attribute_mode="withoutattributes")
Dev
Upload new version
python -m pip install build twine
python -m build
python -m twine upload dist/*
rm -rf dist/*
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
NewsFrames-1.0.5.tar.gz
(14.4 kB
view hashes)
Built Distribution
NewsFrames-1.0.5-py3-none-any.whl
(12.3 kB
view hashes)
Close
Hashes for NewsFrames-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c927c2f280a73c1ea6983633915b8dde40e660854b01dabc86b13baca40b7b84 |
|
MD5 | 96aa81305586ea4d85193446d4854109 |
|
BLAKE2b-256 | 353a7de5808920b9dc5517c76223b611d3210d4a70eeeb47313c97dae3c7f182 |