Update README.md
Browse files
README.md
CHANGED
|
@@ -23,14 +23,35 @@ library_name: transformers
|
|
| 23 |
|
| 24 |
</div>
|
| 25 |
|
| 26 |
-
##
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
## Citation
|
| 36 |
|
|
|
|
| 23 |
|
| 24 |
</div>
|
| 25 |
|
| 26 |
+
## How to use this Model?
|
| 27 |
+
* This model can be accessed via git clone:
|
| 28 |
+
```
|
| 29 |
+
git clone https://huggingface.co/SLPG/Biomedical_French_to_English
|
| 30 |
+
```
|
| 31 |
+
* You can use Fairseq library to access the model for translations:
|
| 32 |
+
```
|
| 33 |
+
from fairseq.models.transformer import TransformerModel
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### Load the model
|
| 37 |
+
```
|
| 38 |
+
model = TransformerModel.from_pretrained('path/to/model')
|
| 39 |
+
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
#### Set the model to evaluation mode
|
| 43 |
+
```
|
| 44 |
+
model.eval()
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
#### Perform inference
|
| 48 |
+
```
|
| 49 |
+
input_text = 'Hello, how are you?'
|
| 50 |
+
|
| 51 |
+
output_text = model.translate(input_text)
|
| 52 |
+
|
| 53 |
+
print(output_text)
|
| 54 |
+
```
|
| 55 |
|
| 56 |
## Citation
|
| 57 |
|