z-dickson commited on
Commit
8067575
·
verified ·
1 Parent(s): a7d0f0b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -1
README.md CHANGED
@@ -75,4 +75,25 @@ Model training on 120,000 assorted political documents -- mostly from the [Compa
75
  | 19 | 0.92 | 0.91 | 0.92 | 239 |
76
  | Accuracy | --- 0.85 --- | | | |
77
  | Macro Avg | 0.85 | 0.85 | 0.85 | 4720 |
78
- | Weighted Avg | 0.85 | 0.85 | 0.85 | 4720 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  | 19 | 0.92 | 0.91 | 0.92 | 239 |
76
  | Accuracy | --- 0.85 --- | | | |
77
  | Macro Avg | 0.85 | 0.85 | 0.85 | 4720 |
78
+ | Weighted Avg | 0.85 | 0.85 | 0.85 | 4720 |
79
+
80
+
81
+
82
+
83
+ ```{python}
84
+ from transformers import AutoModelForSequenceClassification
85
+ from transformers import TextClassificationPipeline, AutoTokenizer
86
+
87
+ mp = 'z-dickson/CAP_multilingual'
88
+ model = AutoModelForSequenceClassification.from_pretrained(mp)
89
+ tokenizer = AutoTokenizer.from_pretrained(mp)
90
+
91
+ classifier = TextClassificationPipeline(tokenizer=tokenizer, model=model, device=0)
92
+
93
+ classifier("""
94
+ To ask the Secretary of State for Energy and Climate \\
95
+ Change what estimate he has made of the proportion of carbon \\
96
+ dioxide emissions arising in the UK attributable to burning.
97
+ """
98
+ )
99
+ ```