Update README.md

This commit is contained in:
Prithiviraj Damodaran 2021-05-11 06:48:55 +00:00 committed by huggingface-web
parent d314313c7d
commit 845ef10820
1 changed files with 23 additions and 22 deletions

View File

@ -10,14 +10,16 @@ pip install git+https://github.com/PrithivirajDamodaran/Parrot.git
``` ```
### Quickstart ### Quickstart
```python ```python
from parrot import Parrot from parrot import Parrot
import torch import torch
import warnings import warnings
warnings.filterwarnings("ignore") warnings.filterwarnings("ignore")
''' '''
uncomment to get reproducable paraphrase generations uncomment to get reproducable paraphrase generations
def random_state(seed): def random_state(seed):
torch.manual_seed(seed) torch.manual_seed(seed)
@ -30,7 +32,7 @@ random_state(1234)
#Init models (make sure you init ONLY once if you integrate this to your code) #Init models (make sure you init ONLY once if you integrate this to your code)
parrot = Parrot(model_tag="prithivida/parrot_paraphraser_on_T5", use_gpu=False) parrot = Parrot(model_tag="prithivida/parrot_paraphraser_on_T5", use_gpu=False)
phrases = ["Can you recommed some upscale restaurants in Rome?", phrases = ["Can you recommed some upscale restaurants in Newyork?",
"What are the famous places we should not miss in Russia?" "What are the famous places we should not miss in Russia?"
] ]
@ -44,29 +46,28 @@ for phrase in phrases:
``` ```
``` ```
----------------------------------------------------------------------------- ----------------------------------------------------------------------
Input_phrase: Can you recommed some upscale restaurants in Rome? Input_phrase: Can you recommed some upscale restaurants in Newyork?
----------------------------------------------------------------------------- ----------------------------------------------------------------------
"which upscale restaurants are recommended in rome?" list some excellent restaurants to visit in new york city?
"which are the best restaurants in rome?" what upscale restaurants do you recommend in new york?
"are there any upscale restaurants near rome?" i want to try some upscale restaurants in new york?
"can you recommend a good restaurant in rome?" recommend some upscale restaurants in newyork?
"can you recommend some of the best restaurants in rome?" can you recommend some high end restaurants in newyork?
"can you recommend some best restaurants in rome?" can you recommend some upscale restaurants in new york?
"can you recommend some upscale restaurants in rome?" can you recommend some upscale restaurants in newyork?
----------------------------------------------------------------------------- ----------------------------------------------------------------------
Input_phrase: What are the famous places we should not miss in Russia Input_phrase: What are the famous places we should not miss in Russia
----------------------------------------------------------------------------- ----------------------------------------------------------------------
"which are the must do places for tourists to visit in russia?" what should we not miss when visiting russia?
"what are the best places to visit in russia?" recommend some of the best places to visit in russia?
"what are some of the most visited sights in russia?" list some of the best places to visit in russia?
"what are some of the most beautiful places in russia that tourists should not miss?" can you list the top places to visit in russia?
"which are some of the most beautiful places to visit in russia?" show the places that we should not miss in russia?
"what are some of the most important places to visit in russia?" list some famous places which we should not miss in russia?
"what are some of the most famous places of russia?"
"what are some places we should not miss in russia?"
``` ```
### How to get syntactic and phrasal diversity/variety in your paraphrases using parrot? ### How to get syntactic and phrasal diversity/variety in your paraphrases using parrot?
You can play with the do_diverse knob (check out the next section for more knobs). You can play with the do_diverse knob (check out the next section for more knobs).