Adding a AbstractRemoteModelEngine class that uses Zookeeper & Curator to make a connection to the Remote Client Server in the GKE Cluster.
Adding a NEREngine class that performs NER prediction requests to the Remote Client Server through the AbstractRemoteModelEngine class.
Adding a NERReactor to call the predict() method of the NEREngine class.
You will need to be able to port forward the Zookeeper deployment and Remote Client Server instance of GLiNER to your local machine to test this.
NER( engine = "abd20c47-2ce7-45ef-a10a-572150a3b0d6" , prompt = "John Smith works at Microsoft in Seattle" , entities=["PERSON", "ORGANIZATION", "LOCATION"], maskEntities=["PERSON", "ORGANIZATION"] )
from gaas_gpt_model import ModelEngine
text="John Smith works at Microsoft in Seattle."
entities=["PERSON", "ORGANIZATION", "LOCATION"]
mask_entities=["PERSON", "ORGANIZATION"]
model = ModelEngine(engine_id = "abd20c47-2ce7-45ef-a10a-572150a3b0d6", insight_id='${i}')
output = model.ner(text = text, entities = entities, mask_entities = mask_entities
Example Response
{
"response": {
"output": "m_995GEF works at m_H57RBW in Seattle",
"raw_output": [
{
"start": 0,
"end": 10,
"text": "John Smith",
"label": "PERSON",
"score": 0.9934297204017639
},
{
"start": 20,
"end": 29,
"text": "Microsoft",
"label": "ORGANIZATION",
"score": 0.9744566082954407
},
{
"start": 33,
"end": 40,
"text": "Seattle",
"label": "LOCATION",
"score": 0.9642370939254761
}
],
"mask_values": {
"Microsoft": "m_H57RBW",
"m_H57RBW": "Microsoft",
"John Smith": "m_995GEF",
"m_995GEF": "John Smith"
},
"input": "John Smith works at Microsoft in Seattle",
"entities": [
"PERSON",
"ORGANIZATION",
"LOCATION"
]
}
}
Adding a
AbstractRemoteModelEngine
class that uses Zookeeper & Curator to make a connection to the Remote Client Server in the GKE Cluster.Adding a
NEREngine
class that performs NER prediction requests to the Remote Client Server through theAbstractRemoteModelEngine
class.Adding a
NERReactor
to call thepredict()
method of theNEREngine
class.You will need to be able to port forward the Zookeeper deployment and Remote Client Server instance of GLiNER to your local machine to test this.
Example Response