I want to move BERT for a moment, I tried an example that seems to move in an instant.
At the following site https://www.ai-shift.jp/techblog/281
Using BERT, ** solving the TOEIC Part 5 problem **, an example was shown. It was about 30 lines of code, so I tried moving it.
As a fill-in-the-blank problem An English Primer for Python 「introducing Python」 O'Reilly Media,Inc (First Edition 2016-02-26 Third release) I quoted the sentence and made a hole for each sentence.
text is a sentence with one hole (* is a hole). candidate is a candidate to fill in the blanks. About 5 pieces.
Below, I made three questions.
text = "In Python, a lambda function is an anonymous function * as a single statement."
candidate = ["experssion", "used", "expressed", "using", "known"]
text = "Truncating integer division * you an integer answer."
candidate = ["gives", "makes", "presents", "takes", "give"]
text = "What * you get if you typed the following?"
candidate = ["did", "will", "would", "do", "are"]
Added 1 question. This is not a Python primer, but a tensorflow lite? Or something Run-time error message.
text = "Model provided has model identifier 'TFL2', * be 'TFL3'"
candidate = ["can", "could", "would", "shall", "should"]
** All questions are correct ** as follows.
(3, 'expressed')
(0, 'gives')
(0, 'would')
(0, 'should')
I felt the high level of BERT. I thought of candidates other than the correct answer, but there was a slight difference in power with BERT. .. .. (I would like to try again in Japanese or think about another problem. It's a chat, but I think it's very easy to say "should" or "would". .. .. ) If you have any comments, please let us know.
Recommended Posts