Skip to content

Chatbot to assist researcher with Graphical Database like Neo4j

Notifications You must be signed in to change notification settings

Jitmandal051004/neo4j_chatbot_py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moviedb_neo4j Chatbot

This project is designed to work with the provided Movie Database. Using a different database may lead to unexpected errors.

Prerequisites

  • Install Miniconda and Conda

  • Install Ollama and Hugging Face Model

    • Install Ollama from Ollama.
    • Search for lakkeo/stable-cypher-instruct-3b on Hugging Face.
    • Click Use this model and select Ollama.
    • Choose either Q5_K_M or Q8_0 (NOTE - Q8_0 less hallucinates and has higher accuracy and I would not recommend to go to higher model as it needs more compute).
    • Copy the command shown (e.g., ollama run hf.co/lakkeo/stable-cypher-instruct-3b:Q8_0).
    • Open the terminal and run the copied command.
    • The first installation may take some time, but subsequent runs will be faster depending on your hardware specs.
  • Install Neo4j Desktop and Setup Database

    • Download the Neo4j Desktop App Image from the Deployment Center.
    • Select the Linux App Image and download it.
    • Navigate to the directory where the file is downloaded:
      cd /path/to/downloaded/file
    • Set the file as executable and run it:
      chmod +x <file_name>
      ./<file_name>
    • Paste the activation key when prompted.
    • Turn on the Movie Database.
    • Navigate to Apps and start the Browser.
    • Open the Neo4j Browser App.
    • Copy the contents of MoviesDataset.txt, paste them into the Neo4j Browser and Execute it to store those values in the databse.
  • Install Git and Clone the Repository

    • Ensure Git is installed.
    • Clone the repository:
      git clone https://github.com/Jitmandal051004/neo4j_chatbot_py.git <repo_folder_name>
      cd <repo_folder>
    • After cloning you can remove the ./images folder
  • Set Up the Conda Environment

    • Using Conda (Recommended)
      • Create and activate the environment:
        conda env create -f environment.yml
        conda activate <your_env_name>
    • Using Python Virtual Environment (venv)
      • Create and activate the virtual environment:
        python -m venv venv
        source venv/bin/activate 
      • Install dependencies:
        python install -r requirement.txt
    • Additional Notes:
      • Conda is recommended as it handles package dependencies more efficiently.
      • If using venv, ensure you have the correct Python version installed.

Running the Project

  • Run the Python script:
    python text2cypher.py
  • Start the Streamlit app:
    streamlit run QueryApp.py
  • Open the browser and fill in the password.
  • Write your query and execute it.

Example Queries

  • "Show me all the movies available."
  • "Who acted in The Matrix?"
  • "Which movies were directed by Lana Wachowski?"
  • "List all co-actors of Keanu Reeves."
  • "Find me all movies released after the year 2000."
  • "Show movies that feature both Keanu Reeves and Laurence Fishburne."
  • "Who produced The Matrix?"
  • "Find all actors born after 1970."
  • "List movies with the tagline containing 'freedom'."
  • "Get all movies sorted by release year."

Troubleshooting

  • If a query does not return the expected results, click Submit again.
  • The model may sometimes generate excessive text or hallucinate responses.
  • This happens because large language models predict responses based on patterns in training data.
  • If a query returns incorrect results, try rephrasing and submitting again.

ENJOY

📌 WebApp User Interface

WebApp UI

📊 Graphical Visualization

Graphical Result

📋 Tabular Representation

Tabular Result

Q8_0 model result

Q8_0 Result

About

Chatbot to assist researcher with Graphical Database like Neo4j

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages