File size: 1,742 Bytes
86e82d3
 
 
 
 
 
 
 
 
 
 
 
38f815f
86e82d3
6986f2a
 
86e82d3
5f530e5
86e82d3
 
 
 
 
 
 
 
 
38f815f
86e82d3
 
 
 
 
 
 
 
 
38f815f
 
 
 
 
 
cd44189
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
language:
- en
metrics:
- accuracy
base_model:
- climatebert/distilroberta-base-climate-detector
pipeline_tag: text-classification
tags:
- climate
---

# Model Card for climate-filter-FB

## Model Description
This is the fine-tuned climate detection language model with a classification head for detecting climate-related Facebook Posts.

The climate-filter-FB model is fine-tuned using the [climatebert/distilroberta-base-climate-detector](https://huggingface.co/climatebert/distilroberta-base-climate-detector) language model as starting point. It has been fine-tuned on a dataset containing 2000 (translated) Facebook Posts of government communication.

*Note: This model is trained on full posts. It may not perform well on sentences or other data sources.*

## How to Get Started With the Model
You can use the model with a pipeline for text classification:
```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
from transformers.pipelines.pt_utils import KeyDatasetimport datasets
from tqdm.auto import tqdm
model_name = "frwagner/climate_filter_Fb"

# If you want to use your own data, simply load them as 🤗 Datasets dataset, see https://huggingface.co/docs/datasets/loading
dataset = datasets.load_dataset(dataset_name, split="test")

model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name, max_len=512)

pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, device=0)
# See https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline

outputs = []

for text in tqdm(dataset['text']):
    output = pipe(text, padding=True, truncation=True)
    outputs.append(output)

```