Skip to content

Commit

Permalink
WIP: Example working, TODO: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
dschiese committed Mar 25, 2024
1 parent e92112f commit 5443967
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 37 deletions.
16 changes: 13 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#IMPORTANT!!! Change this IP to one of the IP addresses assigned to your host device (e. g. 192.168.178.30)
HOST_IP=127.0.0.1
HOST_IP=192.168.178.37

#VIRTUOSO SETTINGS
DBA_PASSWORD=dba
VIRTUOSO_WEB_PORT=8890
VIRTUOSO_JDBC_PORT=1111

#NED-DBpediaSpotlight component settings
NED_DBPEDIA_SPOTLIGHT_PORT=10008

#KG2KG component settings
KG2KG_COMPONENT_PORT=40444

# Model
MODELTYPE="spacy"#spacy or bert ## initial training with bert is NOT recommended as it cannot yet use the GPU
MODELLANGUAGE="en"#en or de or empty

Expand All @@ -27,8 +36,9 @@ SERVICE_DESCRIPTION_COMPONENT="A component interacting with an NER model"
BIRTH_DATA_WIKIDATA_COMPONENT_NAME=BirthDataQueryBuilderWikidata
BIRTH_DATA_WIKIDATA_COMPONENT_DESCRIPTION="BirthDataQueryBuilder is a Qanary component for finding the birth place and date of people"
BIRTH_DATA_WIKIDATA_PORT=5555
BIRTH_DATA_WIKIDATA_SERVER_HOST=http://${HOST_IP}
BIRTH_DATA_WIKIDATA_SPRING_BOOT_ADMIN_URL=http://${HOST_IP}:8080
QANARY_COMPONENT_SERVER_HOST=http://${HOST_IP}
QANARY_COMPONENT_SPRING_BOOT_ADMIN_URL=http://${HOST_IP}:8080


#QE-Sparql-Endpoint Values, change as needed
SPARQL_EXECUTER_COMPONENT_NAME=SparqlExecuterComponent
Expand Down
2 changes: 1 addition & 1 deletion Chatbot/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def retrieve_birthdate_values_from_graph_and_build_answers(self, graph_id):
def run_pipeline_query(self, text):
try:
pipeline_request_url = self.qanary_pipeline + "/questionanswering?textquestion=" + text + \
"&language=en&componentlist%5B%5D=AutomationServiceComponent, BirthDataQueryBuilderWikidata, SparqlExecuterComponent"
"&language=en&componentlist%5B%5D=NED-DBpediaSpotlight, KG2KG-TranslateAnnotationsOfInstanceToDBpediaOrWikidata, BirthDataQueryBuilderWikidata, SparqlExecuterComponent"
response = requests.request("POST", pipeline_request_url)
response_json = json.loads(response.text)
return response_json["inGraph"]
Expand Down
89 changes: 56 additions & 33 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@ services:
environment:
- DBA_PASSWORD=$DBA_PASSWORD

ned-component:
image: qanary/qanary-component-ned-dbpediaspotlight
ports:
- "$NED_DBPEDIA_SPOTLIGHT_PORT:10008"
#network_mode: host
restart: unless-stopped
environment:
- SERVER_HOST=$QANARY_COMPONENT_SERVER_HOST
- SERVER_PORT=$NED_DBPEDIA_SPOTLIGHT_PORT
- SPRING_BOOT_ADMIN_URL=$QANARY_COMPONENT_SPRING_BOOT_ADMIN_URL
- SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE_BASE_URL=$QANARY_COMPONENT_SERVER_HOST:$NED_DBPEDIA_SPOTLIGHT_PORT

kg2kg-component:
image: qanary/qanary-component-kg2kg-translateannotationsofinstance
ports:
- "$KG2KG_COMPONENT_PORT:40444"
environment:
- QANARY_COMPONENT_SERVER_HOST=http://${HOST_IP}
- QANARY_COMPONENT_SPRING_BOOT_ADMIN_URL=http://${HOST_IP}:8080
- SERVER_PORT=$KG2KG_COMPONENT_PORT
- SPRING_BOOT_ADMIN_URL=$QANARY_COMPONENT_SPRING_BOOT_ADMIN_URL
- SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE_BASE_URL=$QANARY_COMPONENT_SERVER_HOST:$KG2KG_COMPONENT_PORT

# mlflow:
# image: qanary/qanary-component-logging-mlflow:latest
# #network_mode: host
Expand Down Expand Up @@ -73,12 +96,12 @@ services:
restart: unless-stopped
environment:
- HOST_IP=$HOST_IP
- SERVER_HOST=$BIRTH_DATA_WIKIDATA_SERVER_HOST
- SERVER_HOST=$QANARY_COMPONENT_SERVER_HOST
- SERVER_PORT=$BIRTH_DATA_WIKIDATA_PORT
- SPRING_APPLICATION_NAME=$BIRTH_DATA_WIKIDATA_COMPONENT_NAME
- SPRING_APPLICATION_DESCRIPTION=$BIRTH_DATA_WIKIDATA_COMPONENT_DESCRIPTION
- SPRING_BOOT_ADMIN_URL=$BIRTH_DATA_WIKIDATA_SPRING_BOOT_ADMIN_URL
- SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE-BASE-URL=$BIRTH_DATA_WIKIDATA_SERVER_HOST:$BIRTH_DATA_WIKIDATA_PORT
- SPRING_BOOT_ADMIN_URL=$QANARY_COMPONENT_SPRING_BOOT_ADMIN_URL
- SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE-BASE-URL=$QANARY_COMPONENT_SERVER_HOST:$BIRTH_DATA_WIKIDATA_PORT

sparql-executer:
image: qanary/qanary-component-qe-sparqlexecuter:latest
Expand Down Expand Up @@ -111,36 +134,36 @@ services:
- INITIAL_QUESTION_PARAMETER_NAME="$CHATBOT_UI_INITIAL_QUESTION_PARAMETER_NAME"
- DEFAULT_BACKEND_TYPE="$CHATBOT_UI_DEFAULT_BACKEND_TYPE"

# rasa_server:
# container_name: "rasa_server"
# restart: unless-stopped
# user: root
# build:
# context: Chatbot
# dockerfile: Dockerfile
# volumes:
# - "./Chatbot:/app"
# #network_mode: host
# ports:
# - "5005:5005"
# environment:
# - HOST_IP=$HOST_IP
# - RASA_ACTION_ENDPOINT_HOST=$HOST_IP
# action_server:
# container_name: "action_server"
# restart: unless-stopped
# build:
# context: Chatbot
# dockerfile: ./actions/Dockerfile
# volumes:
# - "./Chatbot/actions:/app/actions"
# - "./Chatbot/data:/app/data"
# #network_mode: host
# ports:
# - "5055:5055"
# environment:
# - QANARY_IP=$HOST_IP
# - SPARQL_IP=$HOST_IP
rasa_server:
container_name: "rasa_server"
restart: unless-stopped
user: root
build:
context: Chatbot
dockerfile: Dockerfile
volumes:
- "./Chatbot:/app"
#network_mode: host
ports:
- "5005:5005"
environment:
- HOST_IP=$HOST_IP
- RASA_ACTION_ENDPOINT_HOST=$HOST_IP
action_server:
container_name: "action_server"
restart: unless-stopped
build:
context: Chatbot
dockerfile: ./actions/Dockerfile
volumes:
- "./Chatbot/actions:/app/actions"
- "./Chatbot/data:/app/data"
#network_mode: host
ports:
- "5055:5055"
environment:
- QANARY_IP=$HOST_IP
- SPARQL_IP=$HOST_IP

volumes:
artifacts: {}

0 comments on commit 5443967

Please sign in to comment.