I am trying to run the code below in a Colab notebook, where the region and sub-region are changing, there are 21 zones defined by the UNSD, and I would like a list of countries for each zone.
I am trying to understand why "Western Europe" is not providing results, but "Eastern Europe" is giving some(times) a list of countries. Other regions have the same problem, so far, I have been unsuccessful in my attempt to create a list of countries in regions. My main problem is that sometimes no results are returned, and when for example, the formatting is removed, the results are inconsistent in the responses, so building a database of countries is not possible (there are too many exceptions).
import vertexai
from vertexai.language_models import TextGenerationModel
vertexai.init(project="XXXXXXXXXXXXXXXXXXX", location="us-central1")
parameters = {
"max_output_tokens": 512,
"temperature": 0,
"top_p": 0.8,
"top_k": 40
}
model = TextGenerationModel.from_pretrained("text-bison@001")
response = model.predict(
""
"The United Nations geoscheme is a system which divides 249 countries and territories in the world into six regional, 17 subregional, and nine intermediate regional groups. It was devised by the United Nations Statistics Division (UNSD) based on the M49 coding classification.
input: Geographical Region
output: country=[]
input: Hi Bard, which countries in \"Europe\" are part of the subregion \"Western Europe\", as defined by the UNSD?
output:
""",
**parameters
)
print(f"Respo
nse from Model: {response.text}")
Creating a list of countries by region should be a simple task, and I would like to understand what I am doing wrong. Any insights into this problem are highly appreciated.