
# Persian-t5-paraphraser

This is a paraphrasing model for the Persian language. It is based on [the monolingual T5 model for Persian.](https://huggingface.co/Ahmad/parsT5-base)

## Usage

```python

>>> pip install transformers
>>> from transformers import (T5ForConditionalGeneration, AutoTokenizer, pipeline)
>>> import torch

model_path = 'erfan226/persian-t5-paraphraser'
model = T5ForConditionalGeneration.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
pipe = pipeline(task='text2text-generation', model=model, tokenizer=tokenizer)

def paraphrase(text):
  for j in range(5):
    out = pipe(text, encoder_no_repeat_ngram_size=5, do_sample=True, num_beams=5, max_length=128)[0]['generated_text']
    print("Paraphrase:", out)

text = "این یک مقالهٔ خرد آلمان است. می‌توانید با گسترش آن به ویکی‌پدیا کمک کنید."
print("Original:", text)
paraphrase(text)

# Original: این یک مقالهٔ خرد آلمان است. می‌توانید با گسترش آن به ویکی‌پدیا کمک کنید.
# Paraphrase: این یک مقالهٔ کوچک است.
# Paraphrase: این یک مقالهٔ کوچک است.
# Paraphrase: شما می توانید با گسترش این مقاله، به کسب و کار خود کمک کنید.
# Paraphrase: می توانید با گسترش این مقالهٔ خرد آلمان کمک کنید.
# Paraphrase: شما می توانید با گسترش این مقالهٔ خرد، به گسترش آن کمک کنید.

```

## Training data
This model was trained on the Persian subset of the [Tapaco dataset](https://huggingface.co/datasets/tapaco). It should be noted that this model was trained on a very small dataset and therefore the performance might not be as expected, for now.
{"language": "fa", "tags": ["paraphrasing"], "datasets": ["tapaco"], "widget": [{"text": "\u0627\u06cc\u0646 \u06cc\u06a9 \u0645\u0642\u0627\u0644\u0647\u0654 \u062e\u0631\u062f \u0622\u0644\u0645\u0627\u0646 \u0627\u0633\u062a. \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u06af\u0633\u062a\u0631\u0634 \u0622\u0646 \u0628\u0647 \u0648\u06cc\u06a9\u06cc\u200c\u067e\u062f\u06cc\u0627 \u06a9\u0645\u06a9 \u06a9\u0646\u06cc\u062f."}, {"text": "\u0628\u0631\u0627\u06cc \u062e\u0631\u06cc\u062f \u06cc\u06a9 \u06a9\u062a\u0627\u0628 \u0628\u0627\u06cc\u062f \u0627\u0632 \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0627\u06cc\u0646\u062a\u0631\u0646\u062a\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f."}]}
transformers pytorch t5 text2text-generation paraphrasing fa dataset:tapaco autotrain_compatible endpoints_compatible text-generation-inference region:us
TAGS
#transformers #pytorch #t5 #text2text-generation #paraphrasing #fa #dataset-tapaco #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 


# Persian-t5-paraphraser

This is a paraphrasing model for the Persian language. It is based on the monolingual T5 model for Persian.

## Usage



## Training data
This model was trained on the Persian subset of the Tapaco dataset. It should be noted that this model was trained on a very small dataset and therefore the performance might not be as expected, for now.
# Persian-t5-paraphraser

This is a paraphrasing model for the Persian language. It is based on the monolingual T5 model for Persian. ## Usage ## Training data
This model was trained on the Persian subset of the Tapaco dataset. It should be noted that this model was trained on a very small dataset and therefore the performance might not be as expected, for now.
TAGS
#transformers #pytorch #t5 #text2text-generation #paraphrasing #fa #dataset-tapaco #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
 # Persian-t5-paraphraser

This is a paraphrasing model for the Persian language. It is based on the monolingual T5 model for Persian. ## Usage ## Training data
This model was trained on the Persian subset of the Tapaco dataset. It should be noted that this model was trained on a very small dataset and therefore the performance might not be as expected, for now.
passage: TAGS
#transformers #pytorch #t5 #text2text-generation #paraphrasing #fa #dataset-tapaco #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
# Persian-t5-paraphraser

This is a paraphrasing model for the Persian language. It is based on the monolingual T5 model for Persian.## Usage## Training data
This model was trained on the Persian subset of the Tapaco dataset. It should be noted that this model was trained on a very small dataset and therefore the performance might not be as expected, for now.