Comments (6)
It can't, you can only use it to get probabilities if a single missing word in a sentence (or a small number of missing words). This is one of the fundamental ideas, that masked LMs give you deep bidirectionality, but you no longer have a well-formed probability distribution over the sentence (which in general, we don't care about).
from bert.
What about mask each word sequentially. Then score sentence by summary of word score.
from bert.
Alex Wang and Kyunghyun Cho are using in BERT has a Mouth, and It Must Speak: BERT as a Markov Random Field Language Model the unnormalized log-probabilities to rank a set of sentences. For this purpose it seems to work.
from bert.
What about mask each word sequentially. Then score sentence by summary of word score.
That way your calculation won't be correct.
Let's say the sentence has only two tokens x1 and x2. Your calculation well give P(x1 | x2) * P(x2 | x1), which doesn't lead to the probability of the whole sentence. Note that this is not to say what you intended was not doable -- it's just that your way probably won't work.
from bert.
You can fine-tune BERT to be LM: https://arxiv.org/abs/1904.09408
from bert.
using BERT as a language Model · Issue #37 · huggingface/pytorch-pretrained-BERT
It's actually like what @jacobdevlin-google have said, bert is really not a language model.
from bert.
Related Issues (20)
- sussy baka HOT 1
- Data source you used for training the wordpiece model in your original paper HOT 2
- Notas
- Bert:tensorflow:Error recorded from training_loop: Read less bytes than requested HOT 2
- load_model
- My Gmail account password recovery HOT 1
- Hi HOT 1
- bert loading
- Reproducing Experiment Results for Data Augmentation with TriviaQA
- Sentence Splitting Approach in BERT Preprocessing
- Forget password Gmail account HOT 1
- Awesomeness 👌
- Extraction of context Embeddings
- bert中文交流群,交流应用和训练心得 HOT 2
- raise SSLError(e, request=request)
- ValueError: A KerasTensor is symbolic: it's a placeholder for a shape an a dtype. It doesn't have any actual numerical value. You cannot convert it to a NumPy array. HOT 3
- The MRPC dataset downloaded from the script is missing the train.tsv file HOT 1
- Language Translation for classification
- MRPC and CoLA Dataset UnicodeDecodeError
- Internal: Blas GEMM launch failed when running classifier for URLs
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 bert.