Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a ) ( 1 5 points ) Take the pretrained BERT for BertForSequenceClassification model . Extract logits for each token in the sentence using BERT

a)(15 points) Take the pretrained BERT for BertForSequenceClassification model . Extract logits for each token in the sentence using BERT for a sentence. So, for example, if you have the sentence Hello, how are you doing today?, you will get 10 vectors corresponding to each token in the sentence. To get the embeddings, you get the output of BERT (output) and do embeddings = output.last_hidden_state.
b)(15 points) Extract BERT embeddings for all positive and negative sentences in the train.tsv file we used in class for sentiment classification.
c)(20 points) Train a single layer LSTM network with a hidden dimension of 128 to do sentiment classification from BERT outputs. Use a learning rate of 0.01, batch-size of 32.
You dont have to tune the number of iterations. Just run a few iterations and report the accuracy.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

Students also viewed these Databases questions