nguyenquoccuong99/qa-student-kg

1

stars

17

commits

Python

primary language

Jul 18, 2025

updated

README

Knowledge Graph Chatbot

A web application that combines a chatbot with Neo4j knowledge graph visualization capabilities.

Features

  • Chat Interface: Ask questions in Vietnamese and get answers based on the knowledge graph
  • Neo4j Explorer: Run Cypher queries directly against the Neo4j database and view results
  • Schema Viewer: View the Neo4j database schema to understand the data structure

Requirements

  • Python 3.8+
  • Neo4j Database (local or cloud)
  • HuggingFace API token for PhoGPT model

Installation

  1. Clone the repository:
git clone <repository-url>
cd Graduate-project
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables: Create a .env file in the root directory with the following content:
NEO4J_URI=your_neo4j_uri
NEO4J_USER=your_neo4j_username
NEO4J_PASSWORD=your_neo4j_password

Usage

  1. Start the application:
python app.py
  1. Open your browser and navigate to http://localhost:5000

  2. Use the chat interface to ask questions in Vietnamese

  3. Navigate to the Neo4j Explorer page to run Cypher queries

Project Structure

  • app.py: Main Flask application
  • neo4j_retriever.py: Neo4j query and retrieval functionality
  • knowledge_graph.py: Knowledge graph integration with the chatbot
  • Chat/chat.py: HuggingFace PhoGPT integration
  • utils/: Utility functions for Neo4j, embedding, and reranking
  • templates/: HTML templates for the web interface

License

MIT License

Contributors

nguyenquoccuong99/qa-student-kg

1

stars

17

commits

Python

primary language

Jul 18, 2025

updated

README

Knowledge Graph Chatbot

A web application that combines a chatbot with Neo4j knowledge graph visualization capabilities.

Features

  • Chat Interface: Ask questions in Vietnamese and get answers based on the knowledge graph
  • Neo4j Explorer: Run Cypher queries directly against the Neo4j database and view results
  • Schema Viewer: View the Neo4j database schema to understand the data structure

Requirements

  • Python 3.8+
  • Neo4j Database (local or cloud)
  • HuggingFace API token for PhoGPT model

Installation

  1. Clone the repository:
git clone <repository-url>
cd Graduate-project
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables: Create a .env file in the root directory with the following content:
NEO4J_URI=your_neo4j_uri
NEO4J_USER=your_neo4j_username
NEO4J_PASSWORD=your_neo4j_password

Usage

  1. Start the application:
python app.py
  1. Open your browser and navigate to http://localhost:5000

  2. Use the chat interface to ask questions in Vietnamese

  3. Navigate to the Neo4j Explorer page to run Cypher queries

Project Structure

  • app.py: Main Flask application
  • neo4j_retriever.py: Neo4j query and retrieval functionality
  • knowledge_graph.py: Knowledge graph integration with the chatbot
  • Chat/chat.py: HuggingFace PhoGPT integration
  • utils/: Utility functions for Neo4j, embedding, and reranking
  • templates/: HTML templates for the web interface

License

MIT License

Contributors

Languages

Python

43.8%

HTML

20.0%

Jupyter Notebook

19.2%

JavaScript

11.7%

CSS

5.3%