-
rule.py
Program to process the input query (present in hindiQuery.txt) through a set of rules and transform it to a predicate of property-NER pair. This program determines the slots to be filled in the PostgreSQL query -
db_interface.py
Program to convert the query generated by rule.py to a PostgreSQL query, and fetch the result from the database. The program displays the result in Hindi using Google Translate API -
main.py
Main Program which executes all the required codes in squence. This program:- Reads the input query from hindiQuery.txt
- Executes rule.py to generate the intermediate query, and stores it in query_info.txt
- Executes db_interface.py which reads the intermediate query and based on the property, executes a specific PostgreSQL query to fetch the result
- Install PostgreSQL
- Install the extension PostGIS
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
- Import the database from db/create_db.sql
- Import all the .csv files present in db directory to your database
- Install Google API Python Client Library
pip install google-api-python-client
- Install PostgreSQL+Python
pip install psycopg2
- Write your question in Hindi in RuleBasedSystem/hindiQuery.txt
- Execute
RuleBasedSystem/main.py
- switch to JHWNL_1_2 directory
- Compile all files here:
javac -cp JHWNL.jar:. *.java
- Execute GetSynonyms.java to get the list of synonyms of an input Hindi word
java -cp JHWNL.jar:. GetSynonyms