SaraPiscitelli
commited on
Commit
路
1891c96
1
Parent(s):
47c836f
Update README.md
Browse files
README.md
CHANGED
@@ -54,7 +54,6 @@ or load it directly:
|
|
54 |
import torch
|
55 |
|
56 |
from typing import List, Optional
|
57 |
-
from tqdm import tqdm
|
58 |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
|
59 |
|
60 |
class InferenceModel:
|
@@ -88,7 +87,7 @@ class InferenceModel:
|
|
88 |
|
89 |
model = InferenceModel("SaraPiscitelli/roberta-base-qa-v1")
|
90 |
question = "Which name is also used to describe the Amazon rainforest in English?"
|
91 |
-
context = "The Amazon rainforest (Portuguese: Floresta Amaz么nica or Amaz么nia; Spanish: Selva Amaz贸nica, Amazon铆a or usually Amazonia; French: For锚t amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain "Amazonas" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species."
|
92 |
print(model.inference(questions=[question], contexts=[context])[0])
|
93 |
```
|
94 |
In both cases, the answer will be printed out: "Amazonia or the Amazon Jungle"
|
|
|
54 |
import torch
|
55 |
|
56 |
from typing import List, Optional
|
|
|
57 |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
|
58 |
|
59 |
class InferenceModel:
|
|
|
87 |
|
88 |
model = InferenceModel("SaraPiscitelli/roberta-base-qa-v1")
|
89 |
question = "Which name is also used to describe the Amazon rainforest in English?"
|
90 |
+
context = """The Amazon rainforest (Portuguese: Floresta Amaz么nica or Amaz么nia; Spanish: Selva Amaz贸nica, Amazon铆a or usually Amazonia; French: For锚t amazonienne; Dutch: Amazoneregenwoud), also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. States or departments in four nations contain "Amazonas" in their names. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species."""
|
91 |
print(model.inference(questions=[question], contexts=[context])[0])
|
92 |
```
|
93 |
In both cases, the answer will be printed out: "Amazonia or the Amazon Jungle"
|