Coder Social home page Coder Social logo

seo-chat-bot's Introduction

SEO Q&A Chatbot

This Python code implements a chatbot that answers questions related to SEO. The chatbot is based on OpenAI's GPT-3.5 language model, which is a powerful and versatile natural language processing model. Sources used:

  • seobythesea.com
  • holisticseo.digital
  • guest posts published by Koray Tuğberk GÜBÜR on other publications.

Dependencies

This code uses the following libraries:

  • streamlit: for building the user interface.
  • pinecone: for retrieving relevant text chunks based on a user's question.
  • openai: for generating responses to user questions.
  • streamlit_chat: for displaying chat history in the user interface.

To install these libraries, use the following command:

pip install streamlit pinecone openai streamlit_chat

Usage

To run this code, first set the PINECONE_API_KEY and OPEN_AI_API_KEY environment variables with your Pinecone and OpenAI API keys, respectively. You can get an OpenAI API key by creating an account on the OpenAI website.

Then, run the following command:

streamlit run streamlit_app.py

This will start the Streamlit server, and you can access the chatbot by opening a web browser and navigating to http://localhost:8501.

How it Works

The chatbot works as follows:

  1. The user enters a question in the input field.
  2. The chatbot retrieves relevant text chunks based on the user's question using the Pinecone similarity search service.
  3. The chatbot adds the user's question to the retrieved text chunks to create an augmented query.
  4. The chatbot generates a response to the augmented query using OpenAI's GPT-3.5 (Chat GPT) language model.
  5. The chatbot displays the response to the user, along with the chat history.

The chat history is saved in the st.session_state dictionary, which is a dictionary that persists across Streamlit sessions. The message function from the streamlit_chat library is used to display the chat history in the user interface.

seo-chat-bot's People

Contributors

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