Download google.py from Jinwchoi06/bert-ensemble: direct link, hf CLI and curl.
- Browser
- Download file 386 Bytes
-
https://huggingface.co/Jinwchoi06/bert-ensemble/resolve/main/google.py
- Command line
-
hf download hf://Jinwchoi06/bert-ensemble/google.py
-
curl -L -o google.py https://huggingface.co/Jinwchoi06/bert-ensemble/resolve/main/google.py
386 Bytes
| from transformers import pipeline | |
| # google bert tasks | |
| # fill-mask | |
| # feature extraction | |
| # have to use more specific models/other models for other tasks | |
| # for mask gen | |
| unmasker = pipeline('fill-mask', model='bert-base-uncased') | |
| results = unmasker("Obama is [MASK].") | |
| for prediction in results: | |
| print(f"Score: {prediction['score']:.4f} | Prediction: {prediction['sequence']}") |