Downloads · 30 days
0
shyeon5898/paxmeter
paxmeter is a text classification model from shyeon5898. Use it when you need a label for a piece of text. The card lists the license as gemma.
This model is designed to quantitatively convert how the world has changed based on news articles.
Downloads · 30 days
0
Access
Public
Updated Oct 3, 2024
Repo size
47.8 MB
Likes
0
Public
Click a slice to open those files.
.json17.6 MB · 46%
From the Hugging Face model README
This model is designed to quantitatively convert how the world has changed based on news articles.
Based on world news articles from 2000 to 2011, the data has been processed, and the cumulative results are as follows.

PaxMeter quantifies how the world has changed based on the countries mentioned in news articles and the sentiment of those articles.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from huggingface_hub import hf_hub_download
model = AutoModelForSequenceClassification.from_pretrained("shyeon5898/paxmeter")
tokenizer = AutoTokenizer.from_pretrained("shyeon5898/paxmeter")
rep=hf_hub_download(repo_id="shyeon5898/paxmeter", filename="id2label.json")
with open(rep, "r") as json_file:
i2l = json.load(json_file)
f_pipe = pipeline("text-classification", model=f_model, tokenizer=tokenizer)
input_text = "The South's unification minister, Jeong Se-hyun, told Kim Yong-nam in Pyongyang that the revelation had darkened the mood, and urged the North to end its programme"
outputs = f_pipe(a)
outputs[0]['label']
print(i2l[outputs[0]['label'].split('_')[1]])
-0.108
Positive results indicate that the world has become more peaceful, while negative results signify that the world has become more chaotic.