/GenAI-1

Prompt engineering is a concept in AI[NLP]. Prompt engineering typically works by converting one or more tasks to a prompt-based dataset and training a language model with what has been called "prompt-based learning" or just "prompt learning".

Primary LanguageJupyter Notebook

GenAI-1


Note: GenAI-2 repo can be found here.


1] Prompt Engineering

This repo will describe how LLMs work, provide best practices for prompt engineering, and show how LLM APIs can be used in applications for a variety of tasks, including:

  1. Summarizing (e.g., summarizing user reviews for brevity)
  2. Inferring (e.g., sentiment classification, topic extraction)
  3. Transforming text (e.g., translation, spelling & grammar correction)
  4. Expanding (e.g., automatically writing emails)

Also, The two key principles for writing effective prompts:

  1. Write clear and Specific Instructions.
  2. Give Model the time to think.

Here, We also build a custom chatbot.

Best Course: https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/


2] Chatbot using the OpenAI

To create a chatbot using the OpenAI, you can follow these step-by-step instructions:

  1. Set up an OpenAI account: Visit the OpenAI website (https://openai.com) and create an account.
  2. Get OpenAI API access: Once you have an account, navigate to the OpenAI API page and access the API Key.
  3. Install OpenAI Python package: pip install openai.
  4. Prepare your data: Format your data in a way that can be used by the chatbot. You can store your data in a text file, a database, or any other suitable format. Ensure that the data is well-structured and contains the necessary information for generating explanations.
  5. Define a function for generating explanations: Create a function that takes a user's question as input and generates an explanation based on the data. This function will utilize the OpenAI API to generate responses.
  6. Call the function with your question: Invoke the generate_explanation function with your question and the relevant data to obtain the explanation.
  7. Iterate and refine: Test your chatbot with various questions and data to see how well it performs. Refine your code, tweak the parameters, and iterate based on the results until you achieve the desired performance.

Extra:

  • Enhance the chatbot as needed: Depending on your requirements, you can add additional features such as natural language processing, data preprocessing, or context awareness to improve the chatbot's functionality.

Screenshot 2023-03-19 at 8 27 00 AM


Multi-Chat PDF:

ScreenShot
happy.Halloween.mp4

Document Summarization with LaMini

WhatsApp Image 2023-11-01 at 2 35 13 PM