
# RuBERTConv Toxic Editor

## Model description

Tagging model for detoxification based on [rubert-base-cased-conversational](https://huggingface.co/DeepPavlov/rubert-base-cased-conversational).

4 possible classes:
- Equal = save tokens
- Replace = replace tokens with mask
- Delete = remove tokens
- Insert = insert mask before tokens

Use in pair with [mask filler](https://huggingface.co/IlyaGusev/sber_rut5_filler).

## Intended uses & limitations

#### How to use

Colab: [link](https://colab.research.google.com/drive/1NUSO1QGlDgD-IWXa2SpeND089eVxrCJW)

```python
import torch
from transformers import AutoTokenizer, pipeline

tagger_model_name = "IlyaGusev/rubertconv_toxic_editor"

device = "cuda" if torch.cuda.is_available() else "cpu"
device_num = 0 if device == "cuda" else -1
tagger_pipe = pipeline(
    "token-classification",
    model=tagger_model_name,
    tokenizer=tagger_model_name,
    framework="pt",
    device=device_num,
    aggregation_strategy="max"
)

text = "..."
tagger_predictions = tagger_pipe([text], batch_size=1)
sample_predictions = tagger_predictions[0]
print(sample_predictions)
```

## Training data

- Dataset: [russe_detox_2022](https://github.com/skoltech-nlp/russe_detox_2022/tree/main/data)

## Training procedure

- Parallel corpus convertion: [compute_tags.py](https://github.com/IlyaGusev/rudetox/blob/main/rudetox/marker/compute_tags.py)
- Training script: [train.py](https://github.com/IlyaGusev/rudetox/blob/main/rudetox/marker/train.py)
- Pipeline step: [dvc.yaml, train_marker](https://github.com/IlyaGusev/rudetox/blob/main/dvc.yaml#L367)

## Eval results

TBA
{"language": ["ru"], "license": "apache-2.0", "tags": ["token-classification"], "widget": [{"text": "\u0401\u043f\u0442\u0430, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u043f\u0440\u0438\u0434\u0443\u0440\u043e\u043a \u0438 \u044f \u0436\u0438\u0432\u0443 \u0432 \u0436\u043e\u043f\u0435"}]}
transformers pytorch bert token-classification ru license:apache-2.0 autotrain_compatible endpoints_compatible region:us
TAGS
#transformers #pytorch #bert #token-classification #ru #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 


# RuBERTConv Toxic Editor

## Model description

Tagging model for detoxification based on rubert-base-cased-conversational.

4 possible classes:
- Equal = save tokens
- Replace = replace tokens with mask
- Delete = remove tokens
- Insert = insert mask before tokens

Use in pair with mask filler.

## Intended uses & limitations

#### How to use

Colab: link



## Training data

- Dataset: russe_detox_2022

## Training procedure

- Parallel corpus convertion: compute_tags.py
- Training script: URL
- Pipeline step: URL, train_marker

## Eval results

TBA
# RuBERTConv Toxic Editor ## Model description

Tagging model for detoxification based on rubert-base-cased-conversational.

4 possible classes:
- Equal = save tokens
- Replace = replace tokens with mask
- Delete = remove tokens
- Insert = insert mask before tokens

Use in pair with mask filler. ## Intended uses & limitations #### How to use

Colab: link ## Training data

- Dataset: russe_detox_2022 ## Training procedure

- Parallel corpus convertion: compute_tags.py
- Training script: URL
- Pipeline step: URL, train_marker ## Eval results

TBA
TAGS
#transformers #pytorch #bert #token-classification #ru #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 
 # RuBERTConv Toxic Editor ## Model description

Tagging model for detoxification based on rubert-base-cased-conversational.

4 possible classes:
- Equal = save tokens
- Replace = replace tokens with mask
- Delete = remove tokens
- Insert = insert mask before tokens

Use in pair with mask filler. ## Intended uses & limitations #### How to use

Colab: link ## Training data

- Dataset: russe_detox_2022 ## Training procedure

- Parallel corpus convertion: compute_tags.py
- Training script: URL
- Pipeline step: URL, train_marker ## Eval results

TBA
passage: TAGS
#transformers #pytorch #bert #token-classification #ru #license-apache-2.0 #autotrain_compatible #endpoints_compatible #region-us 
# RuBERTConv Toxic Editor## Model description

Tagging model for detoxification based on rubert-base-cased-conversational.

4 possible classes:
- Equal = save tokens
- Replace = replace tokens with mask
- Delete = remove tokens
- Insert = insert mask before tokens

Use in pair with mask filler.## Intended uses & limitations#### How to use

Colab: link## Training data

- Dataset: russe_detox_2022## Training procedure

- Parallel corpus convertion: compute_tags.py
- Training script: URL
- Pipeline step: URL, train_marker## Eval results

TBA