You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Init client with apiKey. Environment will always be set to PRODUCTION for now.
6
+
client=Client(
7
+
apikey='<Your_API_Key>',
8
+
environment=Environment.PRODUCTION,)
9
+
10
+
#Create the input string and prep it to pass it to the API
11
+
reqbody='{"input":{"context":"உப்பு, புளி, மிளகாய் மூன்றும் எப்போதும் ஒன்றாகவே இருக்கும். ஒருநாள், “குழம்பிற்கு யார் முக்கியம்? நீயா! நானா!” என்று சண்டை போட்டன. மூன்று பேரும் தனிதனியாகச் சென்று குழம்பில் சேரலாம் என்று முடிவு செய்தன. முதல் நாள், உப்பு மட்டும் குழம்பில் சேர்ந்து கொண்டது. “ஆ! ஒரே உப்பு! வாயில் வைக்க முடியவில்லை!” என்று எல்லோரும் கத்தினார்கள்","lang":"ta","question": "எவை மூன்றும் எப்போதும் ஒன்றாகவே இருக்கும்?"} }'
12
+
body=jsonpickle.decode(reqbody)
13
+
14
+
#Initialize the corresponding controller Basic or Advacned
15
+
adv_api_controller=client.advanced_api
16
+
17
+
#Call the corresponding API
18
+
result=adv_api_controller.get_qa(body)
19
+
20
+
print("Score: ",result.score)
21
+
print("Start index of the answer in the context: ",result.start)
22
+
print("End index of the answer in the context: ",result.end)
#Init client with apiKey. Environment will always be set to PRODUCTION for now.
6
+
client=Client(
7
+
apikey='<Your_API_Key>',
8
+
environment=Environment.PRODUCTION,)
9
+
10
+
#Create the input string and prep it to pass it to the API
11
+
reqbody='{"input":{"flattable":{"Cities":["Paris, France","London, England","Lyon, France"],"Inhabitants":["2.161","8.982","0.513"]},"sendBackRows":false,"questions":["How many inhabitants in France","How Many inhabitants in England"]} }'
12
+
body=jsonpickle.decode(reqbody)
13
+
14
+
#Initialize the corresponding controller Basic or Advacned
0 commit comments