staka commited on
Commit
2d6da1c
1 Parent(s): bf625f6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -0
README.md CHANGED
@@ -32,6 +32,20 @@ fugu_translator = pipeline('translation', model='staka/fugumt-en-ja')
32
  fugu_translator('This is a cat.')
33
  ```
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  ### Eval results
36
 
37
  The results of the evaluation using [tatoeba](https://tatoeba.org/ja)(randomly selected 500 sentences) are as follows:
 
32
  fugu_translator('This is a cat.')
33
  ```
34
 
35
+ If you want to translate multiple sentences, we recommend using [pySBD](https://github.com/nipunsadvilkar/pySBD).
36
+ ```python
37
+ !pip install transformers sentencepiece pysbd
38
+
39
+ import pysbd
40
+ seg_en = pysbd.Segmenter(language="en", clean=False)
41
+
42
+ from transformers import pipeline
43
+ fugu_translator = pipeline('translation', model='staka/fugumt-en-ja')
44
+ txt = 'This is a cat. It is very cute.'
45
+ print(fugu_translator(seg_en.segment(txt)))
46
+ ```
47
+
48
+
49
  ### Eval results
50
 
51
  The results of the evaluation using [tatoeba](https://tatoeba.org/ja)(randomly selected 500 sentences) are as follows: