Added files model factchecking
Browse files- .gitattributes +2 -0
- README.md +78 -3
- added_tokens.json +3 -0
- config.json +3 -0
- model.safetensors +3 -0
- special_tokens_map.json +3 -0
- spm.model +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
37 |
+
*.json filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,78 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# GordonAI
|
2 |
+
|
3 |
+
GordonAI is an AI package designed for sentiment analysis, emotion detection, and fact-checking classification. The models are pre-trained on three languages: **Italian**, **English**, and **Spanish**.
|
4 |
+
|
5 |
+
## Features
|
6 |
+
|
7 |
+
- **Sentiment Analysis**: Classifies text into three categories: **positive**, **negative**, and **neutral**.
|
8 |
+
- **Emotion Detection**: Identifies the six basic emotions defined by Paul Ekman (1992): **joy**, **sadness**, **fear**, **anger**, **surprise**, **disgust** (plus **neutral**).
|
9 |
+
- **Fact-Checking Classification**: Classifies text into **disinformation**, **hoax**, **fake news**, or **true news**.
|
10 |
+
|
11 |
+
## Installation
|
12 |
+
|
13 |
+
You can install the package using `pip`. Simply run the following command:
|
14 |
+
|
15 |
+
```bash
|
16 |
+
pip install GordonAI
|
17 |
+
```
|
18 |
+
|
19 |
+
## Usage
|
20 |
+
|
21 |
+
### Sentiment Analysis
|
22 |
+
|
23 |
+
You can use the `SentimentAnalyzer` to predict the sentiment of a text. The analyzer classifies texts as positive, negative, or neutral.
|
24 |
+
|
25 |
+
```python
|
26 |
+
from GordonAI.models import SentimentAnalyzer
|
27 |
+
# Initialize the sentiment analyzer
|
28 |
+
analyzer = SentimentAnalyzer()
|
29 |
+
# Predict sentiment of a list of texts
|
30 |
+
result = analyzer.predict(["This is a great product!", "This is a terrible mistake."])
|
31 |
+
# Output the predictions
|
32 |
+
print(result)
|
33 |
+
```
|
34 |
+
|
35 |
+
### Emotion Detection
|
36 |
+
|
37 |
+
You can use the `EmotionAnalyzer` to predict the emotion of a text. The analyzer classifies texts as joy, sadness, fear, anger, surprise, disgust or neutral.
|
38 |
+
|
39 |
+
```python
|
40 |
+
from GordonAI.models import EmotionAnalyzer
|
41 |
+
# Initialize the emotion analyzer
|
42 |
+
emotion_analyzer = EmotionAnalyzer()
|
43 |
+
# Predict emotions of a list of texts
|
44 |
+
result = emotion_analyzer.predict(["I'm so happy today!", "I'm feeling really sad."])
|
45 |
+
# Output the predictions
|
46 |
+
print(result)
|
47 |
+
```
|
48 |
+
|
49 |
+
### Fact-Checking Classification
|
50 |
+
You can use the `FactAnalyzer` to predict whether a texts or a claim falls into categories like disinformation, fake news, hoax, or true news.
|
51 |
+
|
52 |
+
```python
|
53 |
+
from GordonAI.models import FactAnalyzer
|
54 |
+
# Initialize the emotion analyzer
|
55 |
+
fact_analyzer = FactAnalyzer()
|
56 |
+
# Predict emotions of a list of texts
|
57 |
+
result = fact_analyzer.predict(["This news story is about a real event.", "This news article is based on fake information."])
|
58 |
+
# Output the predictions
|
59 |
+
print(result)
|
60 |
+
```
|
61 |
+
|
62 |
+
## Requirements
|
63 |
+
Python >= 3.9
|
64 |
+
transformers
|
65 |
+
torch
|
66 |
+
|
67 |
+
You can install the dependencies using:
|
68 |
+
```bash
|
69 |
+
pip install transformers torch
|
70 |
+
```
|
71 |
+
|
72 |
+
## Acknowledgments
|
73 |
+
|
74 |
+
This package is part of the work for my doctoral thesis. I would like to thank **NeoData** and **Università di Catania** for their valuable contributions to the development of this project.
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
added_tokens.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fb697283833d25e2c711f1bc37730ecd8b20f4bd5f015db1d84aefe0adc9155a
|
3 |
+
size 23
|
config.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d5b1457ef5d3cce5faafe383d9194278d3e5ea7e4f6d363a8ec32fb282838020
|
3 |
+
size 1085
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0c2cde1dfbc623ccf8b55bed6dc778e046c4df69002e18837ea842f0ebb1aef2
|
3 |
+
size 1115274360
|
special_tokens_map.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9463f61e1b109a8eb4688b829260d7c6b1e6dff04c98ff7269bb89e2b92369b9
|
3 |
+
size 286
|
spm.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:13c8d666d62a7bc4ac8f040aab68e942c861f93303156cc28f5c7e885d86d6e3
|
3 |
+
size 4305025
|
tokenizer.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e00b5fa387c7c7510aa60c51f1d92cfb2b32766c8422d0ade77aa07556e04176
|
3 |
+
size 16351029
|
tokenizer_config.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8032d12bf0b260fc43a05ceb8e640f31847c5f97c9ef7c0229109a62458147c7
|
3 |
+
size 19675
|