
# XLM-RoBERTa HeadlineCause Simple

## Model description

This model was trained to predict the presence of causal relations between two headlines. This model is for the Simple task with 3 possible labels: A causes B, B causes A, no causal relation. English and Russian languages are supported.

You can use hosted inference API to infer a label for a headline pair. To do this, you shoud seperate headlines with ```</s>``` token.
For example:
```
Песков опроверг свой перевод на удаленку</s>Дмитрий Песков перешел на удаленку
```

## Intended uses & limitations

#### How to use

```python
from tqdm.notebook import tqdm
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline

def get_batch(data, batch_size):
    start_index = 0
    while start_index < len(data):
        end_index = start_index + batch_size
        batch = data[start_index:end_index]
        yield batch
        start_index = end_index


def pipe_predict(data, pipe, batch_size=64):
    raw_preds = []
    for batch in tqdm(get_batch(data, batch_size)):
        raw_preds += pipe(batch)
    return raw_preds

MODEL_NAME = TOKENIZER_NAME = "IlyaGusev/xlm_roberta_large_headline_cause_simple"
tokenizer = AutoTokenizer.from_pretrained(TOKENIZER_NAME, do_lower_case=False)
model = AutoModelForSequenceClassification.from_pretrained(MODEL_NAME)
model.eval()
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, framework="pt", return_all_scores=True)
texts = [
    (
        "Judge issues order to allow indoor worship in NC churches",
        "Some local churches resume indoor services after judge lifted NC governor’s restriction"
    ),
    (
        "Gov. Kevin Stitt defends $2 million purchase of malaria drug touted by Trump",
        "Oklahoma spent $2 million on malaria drug touted by Trump"
    ),
    (
        "Песков опроверг свой перевод на удаленку",
        "Дмитрий Песков перешел на удаленку"
    )
]
pipe_predict(texts, pipe)
```

#### Limitations and bias

The models are intended to be used on news headlines. No other limitations are known.

## Training data

* HuggingFace dataset: [IlyaGusev/headline_cause](https://huggingface.co/datasets/IlyaGusev/headline_cause)
* GitHub: [IlyaGusev/HeadlineCause](https://github.com/IlyaGusev/HeadlineCause)

## Training procedure

* Notebook: [HeadlineCause](https://colab.research.google.com/drive/1NAnD0OJ0TnYCJRsHpYUyYkjr_yi8ObcA)
* Stand-alone script: [train.py](https://github.com/IlyaGusev/HeadlineCause/blob/main/headline_cause/train.py)

## Eval results

Evaluation results can be found in the [arxiv paper](https://arxiv.org/pdf/2108.12626.pdf).

### BibTeX entry and citation info

```bibtex
@misc{gusev2021headlinecause,
      title={HeadlineCause: A Dataset of News Headlines for Detecting Causalities}, 
      author={Ilya Gusev and Alexey Tikhonov},
      year={2021},
      eprint={2108.12626},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
```
{"language": ["ru", "en"], "license": "apache-2.0", "tags": ["xlm-roberta-large"], "datasets": ["IlyaGusev/headline_cause"], "widget": [{"text": "\u041f\u0435\u0441\u043a\u043e\u0432 \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0433 \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043a\u0443</s>\u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u041f\u0435\u0441\u043a\u043e\u0432 \u043f\u0435\u0440\u0435\u0448\u0435\u043b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043a\u0443"}]}
transformers pytorch xlm-roberta text-classification xlm-roberta-large ru en dataset:IlyaGusev/headline_cause arxiv:2108.12626 license:apache-2.0 autotrain_compatible endpoints_compatible region:us
TAGS
#transformers #pytorch #xlm-roberta #text-classification #xlm-roberta-large #ru #en #dataset-IlyaGusev/headline_cause #arxiv-2108.12626 #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 


# XLM-RoBERTa HeadlineCause Simple

## Model description

This model was trained to predict the presence of causal relations between two headlines. This model is for the Simple task with 3 possible labels: A causes B, B causes A, no causal relation. English and Russian languages are supported.

You can use hosted inference API to infer a label for a headline pair. To do this, you shoud seperate headlines with  token.
For example:


## Intended uses & limitations

#### How to use



#### Limitations and bias

The models are intended to be used on news headlines. No other limitations are known.

## Training data

* HuggingFace dataset: IlyaGusev/headline_cause
* GitHub: IlyaGusev/HeadlineCause

## Training procedure

* Notebook: HeadlineCause
* Stand-alone script: URL

## Eval results

Evaluation results can be found in the arxiv paper.

### BibTeX entry and citation info


# XLM-RoBERTa HeadlineCause Simple ## Model description

This model was trained to predict the presence of causal relations between two headlines. This model is for the Simple task with 3 possible labels: A causes B, B causes A, no causal relation. English and Russian languages are supported.

You can use hosted inference API to infer a label for a headline pair. To do this, you shoud seperate headlines with  token.
For example: ## Intended uses & limitations #### How to use #### Limitations and bias

The models are intended to be used on news headlines. No other limitations are known. ## Training data

* HuggingFace dataset: IlyaGusev/headline_cause
* GitHub: IlyaGusev/HeadlineCause ## Training procedure

* Notebook: HeadlineCause
* Stand-alone script: URL ## Eval results

Evaluation results can be found in the arxiv paper. ### BibTeX entry and citation info
TAGS
#transformers #pytorch #xlm-roberta #text-classification #xlm-roberta-large #ru #en #dataset-IlyaGusev/headline_cause #arxiv-2108.12626 #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 
 # XLM-RoBERTa HeadlineCause Simple ## Model description

This model was trained to predict the presence of causal relations between two headlines. This model is for the Simple task with 3 possible labels: A causes B, B causes A, no causal relation. English and Russian languages are supported.

You can use hosted inference API to infer a label for a headline pair. To do this, you shoud seperate headlines with  token.
For example: ## Intended uses & limitations #### How to use #### Limitations and bias

The models are intended to be used on news headlines. No other limitations are known. ## Training data

* HuggingFace dataset: IlyaGusev/headline_cause
* GitHub: IlyaGusev/HeadlineCause ## Training procedure

* Notebook: HeadlineCause
* Stand-alone script: URL ## Eval results

Evaluation results can be found in the arxiv paper. ### BibTeX entry and citation info
passage: TAGS
#transformers #pytorch #xlm-roberta #text-classification #xlm-roberta-large #ru #en #dataset-IlyaGusev/headline_cause #arxiv-2108.12626 #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 
# XLM-RoBERTa HeadlineCause Simple## Model description

This model was trained to predict the presence of causal relations between two headlines. This model is for the Simple task with 3 possible labels: A causes B, B causes A, no causal relation. English and Russian languages are supported.

You can use hosted inference API to infer a label for a headline pair. To do this, you shoud seperate headlines with  token.
For example:## Intended uses & limitations#### How to use#### Limitations and bias

The models are intended to be used on news headlines. No other limitations are known.## Training data

* HuggingFace dataset: IlyaGusev/headline_cause
* GitHub: IlyaGusev/HeadlineCause## Training procedure

* Notebook: HeadlineCause
* Stand-alone script: URL## Eval results

Evaluation results can be found in the arxiv paper.### BibTeX entry and citation info