The MuHeQA (Multiple and Heterogeneous Question-Answering) system creates natural language answers from natural language questions using knowledge base from both structured (KG) and unstructured (documents) data sources.
Install the muheqa
package:
pip install muheqa
Create a new connection to Wikidata, or DBpedia, or D4C (Drugs4Covid). The first time it may take a few minutes to download the required models:
import muheqa.connector as mhqa
wikidata = mhqa.connect(wikidata=True)
And finally, make a question in natural language!:
response = wikidata.query("Who is the father of Barack Obama")
print("Response:",response)
- Prepare a Python 3 environment and install the Conda framework.
- Clone this repo:
git clone https://github.com/librairy/MuHeQA.git
- Move into the root directory:
cd MuHeQA
- Create an environment (if it does not already exist):
conda create --name .muheqa python=3.9
- Activate the environment:
conda activate .muheqa
- Download the answer classifier and unzip into the root project directory. The folder
resources_dir/
is created.wget -O resources.zip https://delicias.dia.fi.upm.es/nextcloud/index.php/s/Jp5FeoBn57c8k4M/download unzip resources.zip
- Install dependencies
pip install -r requirements.txt
- Install TensorFlow dependencies
conda install -c apple tensorflow-deps
- Install base TensorFlow
pip install tensorflow-macos
- Install tensorflow-metal plugin
pip install tensorflow-metal