readme: ---
  annotations_creators: []
  language:
  - ro
  language_creators:
  - machine-generated
  license: 
  - apache-2.0
  multilinguality:
  - monolingual
  pretty_name: BlackKakapo/t5-small-paraphrase-ro-v2
  size_categories:
  - 100K<n<1M
  source_datasets:
  - original
  tags: []
  task_categories:
  - text2text-generation
  task_ids: []
  ---
  # Romanian grammar
  ![v2.0](https://img.shields.io/badge/V.2-06.08.2022-brightgreen)
  Fine-tune [t5-small-grammar-ro](https://huggingface.co/datasets/BlackKakapo/grammar-ro-v2) model for grammar. Since there is no Romanian dataset for paraphrasing, I had to create my own [dataset v2](https://huggingface.co/datasets/BlackKakapo/grammar-ro-v2). The dataset contains ~1600k examples.
  ### How to use
  ```python
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
  
  tokenizer = AutoTokenizer.from_pretrained("BlackKakapo/t5-small-grammar-ro-v2")
  model = AutoModelForSeq2SeqLM.from_pretrained("BlackKakapo/t5-small-grammar-ro-v2")
  ```
  ### Or
  ```cmd
  pip install happytransformer
  ```
  
  ```python
  from happytransformer import TTSettings, HappyTextToText
  
  happy_tt_save = HappyTextToText('T5',r"BlackKakapo/t5-small-grammar-ro-v2")
  beam_settings =  TTSettings(num_beams=10, min_length=10, max_length=100)
  ```
  ### Generate
  ```python
  sent = "Interesant cym lucreaza modelu dat, carr a fost antrenat cu un dataset foarre mare."
  prefix = "grammar: "
  example = prefix + sent
  
  result = happy_tt_save.generate_text(example, args=beam_settings)
  
  print(result.text)
  ```
  ### Output
  ```out
  Interesant cum lucrează modelul dat, care a fost antrenat cu un dataset foarte mare.
  ```