svjack's picture
Update extract_by_api.py
4dd7741
raw
history blame
480 Bytes
import requests
def call_en_zh_reader(English_Span, Chinese_Sentence):
assert type(English_Span) == type("")
assert type(Chinese_Sentence) == type("")
response = requests.post("https://svjack-extract-similar-chinese-span-by-english-f-5daeb83.hf.space/run/predict", json={
"data": [
English_Span,
Chinese_Sentence,
]}).json()
data = response["data"]
if data:
data = data[0]
pass
else:
pass
return data