Comments (3)
Hi again!
There was indeed a problem when preparing the model for Huggingface. I have now converted our model into a native PyTorch model, you can now use it like any other model:
from transformers import pipeline
import json
pipe = pipeline(task='fill-mask', model='digitalepidemiologylab/covid-twitter-bert')
out = pipe(f"I think I might have {pipe.tokenizer.mask_token}")
print(json.dumps(out, indent=4))
Which gives me:
[
{
"sequence": "[CLS] i think i might have it [SEP]",
"score": 0.48932939767837524,
"token": 2009,
"token_str": "it"
},
{
"sequence": "[CLS] i think i might have. [SEP]",
"score": 0.14833217859268188,
"token": 1012,
"token_str": "."
},
{
"sequence": "[CLS] i think i might have corona [SEP]",
"score": 0.12335461378097534,
"token": 21887,
"token_str": "corona"
},
{
"sequence": "[CLS] i think i might have died [SEP]",
"score": 0.029644010588526726,
"token": 2351,
"token_str": "died"
},
{
"sequence": "[CLS] i think i might have to [SEP]",
"score": 0.02588510327041149,
"token": 2000,
"token_str": "to"
}
]
Let me know if this works for you! And thanks again for letting us know about this!
from covid-twitter-bert.
Hi ogencoglu! Thanks for bringing this to our attention! I'll look into this within the following days. For now, the way to go is to use the TF models (e.g. through TFHub).
from covid-twitter-bert.
Thanks a lot for the fix. I appreciate it!
from covid-twitter-bert.
Related Issues (18)
- Add link to preprint in readme HOT 1
- Failed to convert the TensorFlow model to a PyTorch model HOT 4
- CUDA out of memory Error from loading CT-Bert directly from Huggingface HOT 2
- License? HOT 2
- Failed to download dataset HOT 1
- Strategies for downstream NER tasks with more label
- Make one over CORD-19 HOT 1
- the model architecture of COVID-Twitter-BERT v2 MNLI
- No proper encodings for covid-related terms HOT 1
- Failed to find data adapter HOT 2
- A few observations. HOT 2
- TypeError HOT 1
- Logic behind [UNK] token for pronouns HOT 2
- COVID Category (CC) dataset has 4 invalid formats for Tweet ID HOT 1
- Loss HOT 2
- What are the tokens for Usernames and Hastags in the BERT vocabulary? HOT 1
- Download Twitter-Sentiment SemEval HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from covid-twitter-bert.