Download usage.py from datasetsANDmodels/location-extraction: direct link, hf CLI and curl.
- Browser
- Download file 293 Bytes
-
https://huggingface.co/datasetsANDmodels/location-extraction/resolve/main/usage.py
- Command line
-
hf download hf://datasetsANDmodels/location-extraction/usage.py
-
curl -L -o usage.py https://huggingface.co/datasetsANDmodels/location-extraction/resolve/main/usage.py
293 Bytes
| from transformers import pipeline | |
| extractor = pipeline("text2text-generation", model="datasetsANDmodels/location-extraction") | |
| intent = " I will visit you at botanic garden." | |
| label=extractor(intent)[0]["generated_text"] | |
| if label=="": | |
| label="No location detected" | |
| print (label ) |