SEMOSS / Semoss

Apache License 2.0
28 stars 5 forks source link

AbstractRemoteModelEngine && NEREngine with Zookeeper//Curator #220

Closed ryanweiler92 closed 2 weeks ago

ryanweiler92 commented 2 weeks ago
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"
    ]
  }
}