Store Procedure Returning a ResultSet with Embedded Python
Hello,
I'm looking for a way to write a stored procedure or something to return a ResultSet with Embedded Python.
My goal is the following:
I have a Goal table with a Text field that is free text.
CREATE Table Goal (
Id int,
Text VARCHAR(5000)
);
I would like to create a procedure that returns all the entities (in the iKnow sense) in a new Entity column.
Python code, i would like to use :
import iknowpy
engine = iknowpy.iKnowEngine()
# Row to parse
text = 'This is a test of the Python interface to the iKnow engine. another sentence to test this program with.'
engine.index(text, 'en')
for s in engine.m_index['sentences']:
for e in s['entities']:
if e['type'] == 'Concept':
print(e['index']) # Should return one new row in the result set
Expected result :
Call My_Python_Procedure(Table);
Entity
-----
test
python interface
iknow engine
sentence
program
How do I go about it ?
Product version: IRIS 2022.1