Streaming Text in Idyl E3 2.5.0

Idyl E3The Idyl E3 API has an /extract endpoint that receives text and returns the extracted entities in response. This means you have to make a full HTTP connection for each extraction request. Idyl E3 2.5.0 introduces the ability to accept streaming text through a TCP socket. When Idyl E3 starts it will open a TCP port and listen for incoming text. As text is received the socket will extract entities from the text and return an entity extraction response.

Now you can extract entities from the command line using a tool like netcat:

cat some-file.txt | netcat [idyl-e3-ip-address] [port]

Compare that command with using cURL:

curl -X POST http://idyl-e3-ip-address:port/api/v2/extract -H "Content-Type: plain/text; charset=UTF-8" -d "George Washington was president."

It’s easy to see which command is simpler. Using streaming should make processing text files and other constant sources of text much simpler.

The response to streaming input is identical to the response received from the /extract endpoint. (Both commands above will produce the same output.)

{
   "entities":[
      {
         "text":"George Washington",
         "confidence":0.96,
         "span":{
            "tokenStart":0,
            "tokenEnd":2,
            "characterStart":0,
            "characterEnd":17
         },
         "type":"person",
         "languageCode":"eng",
         "context":"not-set",
         "documentId":"not-set",
         "extractionDate":1502970191843,
         "metadata":
         }
      }
   ],
   "extractionTime":72
}

Streaming is disabled by default. To enable it set the streaming.enabled property to true in Idyl E3’s properties file. Streaming does not currently support authentication. See the Idyl E3 Documentation for more streaming configuration options.

Leave a Reply