Giter Site home page Giter Site logo

rathod-shubham / genai-1 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 88.91 MB

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".

Jupyter Notebook 95.68% Python 4.32%
ai generative-ai gpt nlp-machine-learning prompt-engineering python3

genai-1's Introduction

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

genai-1's People

Contributors

rathod-shubham avatar

Stargazers

JasonSpano avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.