Skip to content
Jos Denys edited this page Oct 4, 2021 · 7 revisions

Interfaces

This page offers an overview of the programmatic interfaces into the entities and context iKnow will identify in natural language text. We offer Core APIs for accessing the iKnow engine directly and tapping into the output in all of its glory, as well as a handful of other interfaces to easily pair up with other NLP and ML technology.

Core APIs

C++

The iKnow engine is written in C++ and therefore this is the primary interface into its functionality.

The main C++ API file is engine.h, defining the class iKnowEngine with the main entry point:

index(TextSource, language)

After indexing all data is stored in iknowdata::Text_Source m_index. "iknowdata" is the namespace used for all classes that contain meaningful data :

  • iknowdata::struct Entity : represents a text entity after indexing.
  • iknowdata::struct Sent_Attribute : represents an attribute sentence marker.
  • iknowdata::struct Path_Attribute : represents a span in the sentence' path after attribute expansion.
  • iknowdata::struct Sentence : represents a sentence in the text source after indexing.
  • iknowdata::Sentence::Path : represents a path in a sentence.
  • iknowdata::struct Text_Source : represents the whole text after indexing.

enginetest.cpp (source) has a demo function (a short demo) that explains every step from indexing to retrieving the results.

⚠️ The main iKnowEngine::index() method currently has 2 limitations : it only works synchronously and single threaded. A mutex is used to synchronize threads internally, no protection is needed from the side of the client.

C

As of version 1.3, a "C" interface is available for direct communication with the iKnow engine from a variety of platforms.

const char* j_response;
iknow_json(R"({"method" : "index", "language" : "en", "text_source" : "Hello World"})", &j_response);

See 'iknowExplicitTest.cpp' for an example of how it works, or the more detailled documentation : C Interface

Python

The C++ library is also exposed through CPython for easy access from Python. See here for more on getting started.

Integrations

SpaCy

WIP

UIMA

WIP