generative Lab
Subject Code | Credits | CIE Marks | SEE Marks | Total Marks | Exam Hours |
---|---|---|---|---|---|
BAIL657C | 01 | 50 | 50 | 100 | 01 |
Generative AI Lab Manual
Experiments :-
1. Explore pre-trained word vectors. Explore word relationships using vector arithmetic. Perform arithmetic
operations and analyze results.
2. Use dimensionality reduction (e.g., PCA or t-SNE) to visualize word embeddings for Q 1. Select 10 words from a
specific domain (e.g., sports, technology) and visualize their embeddings. Analyze clusters and relationships.
Generate contextually rich outputs using embeddings. Write a program to generate 5 semantically similar words
for a given input.
3. Train a custom Word2Vec model on a small dataset. Train embeddings on a domain-specific corpus (e.g., legal,
medical) and analyze how embeddings capture domain-specific semantics.
4. Use word embeddings to improve prompts for Generative AI model. Retrieve similar words using word
embeddings. Use the similar words to enrich a GenAI prompt. Use the AI model to generate responses for the
original and enriched prompts. Compare the outputs in terms of detail and relevance.
5. Use word embeddings to create meaningful sentences for creative tasks. Retrieve similar words for a seed word.
Create a sentence or story using these words as a starting point. Write a program that: Takes a seed word. Generates
similar words. Constructs a short paragraph using these words.
6. Use a pre-trained Hugging Face model to analyze sentiment in text. Assume a real-world application, Load the
sentiment analysis pipeline. Analyze the sentiment by giving sentences to input.
7. Summarize long texts using a pre-trained summarization model using Hugging face model. Load the
summarization pipeline. Take a passage as input and obtain the summarized text.
8. Install langchain, cohere (for key), langchain-community. Get the api key( By logging into Cohere and obtaining
the cohere key). Load a text document from your google drive . Create a prompt template to display the output in
a particular manner.
9. Take the Institution name as input. Use Pydantic to define the schema for the desired output and create a custom
output parser. Invoke the Chain and Fetch Results. Extract the below Institution related details from Wikipedia:
The founder of the Institution. When it was founded. The current branches in the institution . How many
employees are working in it. A brief 4-line summary of the institution.
10. Build a chatbot for the Indian Penal Code. We'll start by downloading the official Indian Penal Code document,
and then we'll create a chatbot that can interact with it. Users will be able to ask questions about the Indian Penal
Code and have a conversation with it.