bert-syntax | Assessing syntactic abilities of BERT | Machine Learning library
kandi X-RAY | bert-syntax Summary
kandi X-RAY | bert-syntax Summary
Assessing syntactic abilities of BERT
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Inflect text
- Join words together
- Generate inflect from a vocab file
- Return the noun of a word
- Return the plural of text
- Get count
- Make a list of lists from a list of lists
- Return a set of words
- Join stems
- Parse a group of Tensors
- Evaluate marvin
- Compare two words
- Define plural verb
- Return a set of words by size
- Compares two words
- Evaluate the gulordava
- Join stems into a single word
- Evaluate Lgd dataset
- Define a noun
- Deprecated
- Converts a group into a string
- Define A rule
- Define a regular expression
- Parse an amo object
- Return a noun
- Return True if the match object is participle
bert-syntax Key Features
bert-syntax Examples and Code Snippets
Community Discussions
Trending Discussions on bert-syntax
QUESTION
As of v2.1, spaCy has a BERT-style language model (LM). It predicts word-vectors instead of words, so I am going to use "words" and "word vectors" interchangeably here.
I need to take a sentence with a word masked, and a list of words, and rank the words by how likely they are to appear in the masked slot. Currently I am using BERT for this (similar to bert-syntax). I would like to see if spaCy's performance on this task is acceptable. Between this file and this one I'm pretty sure it's possible to build something. However, it feels like reaching deeper into the internals of the library than I'd like.
Is there a straightforward way to interact with spaCy's masked language model?
...ANSWER
Answered 2019-Jun-01 at 10:45This is basically the disadvantage of the LMAO approximation. I actually hadn't realised this until it was pointed out to me by someone on the /r/machinelearning
subreddit.
Because we're predicting a vector, we really only get to predict one point in the vector-space. This is really different from predicting a distribution over the words. Imagine we had a gap like The __ of corn.
Let's say a good distribution of fillers for that would be {kernel, ear, piece}
. The vectors for these words aren't especially close, as the word2vec
algorithm is constructing a vector space based on all contexts of the words, and the words are only interchangeable in this context. In the vast majority of uses of piece
, the word ear
would be a really bad substitution.
If the likely fillers aren't close together in the vector-space, there will be no way for the LMAO model to return you an answer that corresponds to that set of words.
If you only need the 1-best answer, the algorithm in spacy pretrain
has a good chance of giving it to you. But if you need the distribution, the approximation breaks down, and you should use something like BERT
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bert-syntax
You can use bert-syntax like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page