[English] | 中文
This project aims to explore the method of generating Gremlin queries from natural language text and verify its feasibility.
Make sure you have Python and pip installed, then run:
pip install -r requirements.txt
The Gremlin-related grammar files have already been processed using ANTLR4 and are located in the ./gremlin
directory. You can directly use them. If you want to process your own .g4
grammar files, you need to install JDK and ANTLR4:
# Update package list
sudo apt update
# Install OpenJDK 21
sudo apt install openjdk-21-jdk
# Verify installation
java -version
javac -version
The ANTLR4 JAR file (antlr-4.13.1-complete.jar
) has already been downloaded and is located in the ./gremlin
directory.
After that, run the build.sh
script to process .g4
files with ANTLR4 and generate parser code:
cd Text2Gremlin
sh ./build.sh
This stage is only based on testing the implementation of Text2Gremli using AST, and has no practical implementation significance
python ./gremlin_ast_gen.py
python ./gremlin_grammar_test.py
python ./gremlin_ast_generator.py
Related code is located in ./schema_gremlin
.
Will be updated soon ...