•  
      reusable_code_components #495626
    Python, Natural Language Processing (NLP), AI Workflow Design, REST APIs

    A simple, CLI-based Question Answering Chatbot using Hugging Face Transformers and OpenAI GPT-3 to answer user queries based on context or general knowledge.

    This project consists of two main chatbot implementations:

    1. A Question Answering Chatbot built using the Hugging Face Transformers library, which leverages pre-trained models (e.g., distilbert-base-uncased-distilled-squad) to answer questions based on a provided context.

    2. A GPT-3 Chatbot that integrates OpenAI’s GPT-3 API to provide human-like answers to a wide range of questions, including general knowledge, scientific, and domain-specific queries. The GPT-3 chatbot supports customizable parameters such as response creativity and length, and provides an interactive chat interface via the command line.

    The project is easy to configure, extend, and suitable for developers looking to integrate NLP-powered conversational AI using open-source and commercial models.

    chatbot_with_ML/ ├── chatbot.py ├── config.py ├── gen.py ├── main.py ├── openai.py ├── README.md └── requirements.txt

    • Install dependencies:
      pip install openai transformers

    • Configure OpenAI API key (for GPT-3 chatbot):
      Set environment variable OPENAI_API_KEY or add your key in the script.

    • Run the Hugging Face QA chatbot script or the GPT-3 chatbot script from the command line.

    • Interact via CLI by typing questions; exit with exit or quit.

    Question Answering Chatbot

    This project includes two chatbots:

    • A Hugging Face-based Question Answering chatbot using pretrained models
    • A GPT-3 powered chatbot using OpenAI API

    Features

    • Ask questions based on given context or general knowledge
    • Uses Hugging Face Transformers and OpenAI GPT-3
    • Easy CLI interface for interaction
    • Customizable parameters for GPT-3 responses

    Installation

    pip install openai transformers
    
    Set your OpenAI API key:
    export OPENAI_API_KEY=your_api_key
    
    Run the chatbot scripts:
    
    python huggingface_qa.py
    python gpt3_chatbot.py
    
    
    2025-06-02
    Active
    Sanjay Patel (sanjay_patel)
    #495626

    Follow-ups

    User avatar
    • Code Content
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Git Repository Url
      -https://openforge.gov.in/plugins/git/smartblocks/chatbot_with_ML.git 
      +https://openforge.gov.in/plugins/git/smartblocks/chatbot_with_ML