Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.19 KB

CLOCQ_Server.md

File metadata and controls

33 lines (25 loc) · 1.19 KB

Server

In this setup, a Flask server is started to interact with CLOCQ. The server can be used on the local machine (localhost), or within a virtual host. The host and port can be specified in the config. Starting the server will take 2 hours roughly, for loading the KB.

Starting the server

You can try the server using the following command:

	nohup python clocq/interface/CLOCQInterfaceServer.py > clocq/interface/SERVER.out &

However, it is recommended to bring the server into production, when using it regularly. This can be done e.g. using gunicorn.

Client

After the server has started, one can create clients to interact with CLOCQ. The possible functionalities can be found in CLOCQInterfaceClient.py. It is possible to use the CLOCQ algorithm, but one can also simply make use of the CLOCQ KB-index, and query e.g. labels or types of specific entities.

Using the client

	from clocq import config
	from clocq.interface.CLOCQInterfaceClient import CLOCQInterfaceClient

	clocq = CLOCQInterfaceClient(host=config.HOST, port=config.PORT)

	kb_item = "Q5"
	res = clocq.get_label(kb_item)
	print(res)