Question: This assignment will provide you with hands - on experience in using state - of - the - art NLP techniques for entity and relation
This assignment will provide you with handson experience in using stateoftheart NLP techniques for entity and relation extraction. It will also allow you to explore the capabilities of pretrained language models for these tasks.
We are going to explore using both spacy alone and spacy Hugging Face Transformers. As you have read in your book, Hugging Face API is a great resource for working with BERT and other LLMsgive python code.
For this assignment, you will use either dataset movie reviews or tripadvisor pick one that is richer in named entities You will build a model that can extract entities and relations from text data. You will first experiment with spacy, and capture the results. Then you will work with a pretrained language model and spacy together, to capture the results. You will then compare the results. You can do all of this in CoLab.
What To Do
If necessary, install the libraries, including Hugging Face Transformers and PyTorch or TensorFlow.
Download the spacy model
Download the pretrained language model using Hugging Face Transformers.
Load the movie review or TripAdvisor dataset. There needs to be entities and relations present for a good extraction.
Preprocess the data, including tokenization and encoding, to prepare it for training.
Perform the entity and relation extraction using spacy
Perform the entity and relation extraction using LLMspacy
Evaluate the performance for both entity and relation extraction tasks.
If you feel lucky: Let's take this one step further and also perform an automatic knowledge graph generation Note: It may not be very good but you will get a sense of how this works and visualize the graph.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
