Spaces:
Runtime error
Runtime error
Update package versions
Browse filesFiles changed (4)
- app.py+3-5
- data/text2int_results.csvAdded+90
- requirements.txt+7-7
- tests/test_text2int.py+1-1
7 unmodified lines8910111213141516171830 unmodified lines49505152535423 unmodified lines787980817 unmodified linesfrom fastapi.templating import Jinja2Templatesfrom pydantic import BaseModelfrom modules.sentiment import sentimentfrom modules.text2int import text2intfrom modules.nlu import prepare_message_data_for_logging# FIXME:# from mathtext.text2int import text2intapp = FastAPI()30 unmodified linescontent = {"message": ml_response}return JSONResponse(content=content)@app.post("/nlu")async def evaluate_user_message_with_nlu_api(request: Request):""" Calls NLU APIs on the most recent user message from Turn.io message data and logs the message data23 unmodified linesint_data_dict = {'type': 'integer', 'data': int_api_resp}return JSONResponse(content=int_data_dict)7 unmodified lines891011121314151630 unmodified lines4748495051525323 unmodified lines7778797 unmodified linesfrom fastapi.templating import Jinja2Templatesfrom pydantic import BaseModelfrom modules.nlu import prepare_message_data_for_loggingfrom mathtext.sentiment import sentimentfrom mathtext.text2int import text2intapp = FastAPI()30 unmodified linescontent = {"message": ml_response}return JSONResponse(content=content)@app.post("/nlu")async def evaluate_user_message_with_nlu_api(request: Request):""" Calls NLU APIs on the most recent user message from Turn.io message data and logs the message data23 unmodified linesint_data_dict = {'type': 'integer', 'data': int_api_resp}return JSONResponse(content=int_data_dict)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990input,output,text2int,scorefourteen,14,14,Trueforteen,14,14,Trueone thousand four hundred ninety two,1492,1492,Trueone thousand ninety two,1092,1092,TrueFourteen Hundred Ninety-Two,1492,1492,TrueFourteen Hundred,1400,1400,TrueNinety nine,99,99,Truefifteen thousand five hundred-sixty,15560,15560,Truethree hundred fifty,350,350,Trueone nine eight five,1985,1985,Truenineteen eighty-five,1985,1605,Falseoh one,1,1,Truesix oh 1,601,601,Truesex,6,6,Truesix,6,6,Trueeight oh,80,8,Falseeighty,80,80,Trueate,8,1,Falsedouble eight,88,32202,Falseeight three seven five three O nine,8375309,8375329,Falseeight three seven five three oh nine,8375309,8375309,Trueeight three seven five three zero nine,8375309,8375309,Trueeight three seven five three oh ni-ee-ine,8375309,837530619,Falsetwo eight,28,16,Falseseven oh eleven,7011,77,Falseseven elevens,77,77,Trueseven eleven,711,77,Falseninety nine oh five,9905,149,Falseseven 0 seven 0 seven 0 seven,7070707,7070707,True123 hundred,123000,223,False5 o 5,505,525,False15 o 5,1505,22,False15-o 5,1505,22,False15 o-5,1505,22,False911-thousand,911000,911000,Truetwenty-two twenty-two,2222,44,Falsetwenty-two twenty-twos,484,44,Falsefour eighty four,484,404,Falsefour eighties,320,72,Falsefour eighties and nine nineties,1130,243,Falseninety nine hundred and seventy seven,9977,276,Falseseven thousands,7000,7000,True2 hundreds,200,200,True99 thousands and one,99001,99001,True"forty-five thousand, seven hundred and nine",45709,1161,Falseeighty eight hundred eighty,8880,268,Falsea hundred hundred,10000,32202,Falsea hundred thousand,100000,32202,Falsea hundred million,100000000,32202,Falsenineteen ninety nine,1999,1809,Falseforteen twenty seven,1427,307,Falseseventeen-thousand and seventy two,17072,17072,Truetwo hundred and nine,209,209,Truetwo thousand ten,2010,2010,Truetwo thousand and ten,2010,2010,Truetwelve million,12000000,12000000,True8 billion,8000000000,8000000000,Truetwenty ten,2010,2010,Truethirty-two hundred,3200,3200,Truenine,9,9,Trueforty two,42,42,True1 2 three,123,123,Truefourtean,14,14,Trueone tousand four hundred ninty two,1492,1492,TrueFurteen Hundrd Ninety-Too,1492,1492,Trueforrteen,14,14,Truesevnteen-thosand and seventy two,17072,17072,Trueninety nine hundred ad seventy seven,9977,32202,Falseseven thusands,7000,7000,True2 hunreds,200,200,True99 tousands and one,99001,99001,Trueeighty ate hundred eighty,8880,261,Falsefourteen Hundred,1400,1400,True8 Bilion,8000000000,8000000,Falseone million three thousand one,1003001,1003001,Truefour million nine thousand seven,4009007,4009007,Truetwo million five hundred thousand,2500000,2001500,Falsetwo tousand ten,2010,2010,Truetwo thousand teen,2010,2007,Falsetvelve milion,12000000,12000000,Truetventy ten,2010,2010,Truetirty-twoo hunred,3200,3200,Truesevn thoosands,7000,7000,Truefive,5,5,Trueten,10,10,Trueone two three and ten,12310,51,FalseONE MILLion three hunded and fiv,1000305,1000305,True"50,500 and six",50506,50506,Trueone_million_and_five,1000005,1000005,True12345678910111213141516fastapi==0.74.*requests==2.27.*sentencepiece==0.1.*torch==1.11.*transformers==4.*uvicorn[standard]==0.17.*pydanticmathtext @ git+https://gitlab.com/tangibleai/community/mathtext@mainspacypandasmatplotlibpytesthttpxdjango-environsupabase12345678910111213141516fastapi==0.74.*requests==2.27.*sentencepiece==0.1.*torch==1.12.*transformers==4.24.*uvicorn[standard]==0.17.*pydanticmathtext @ git+https://gitlab.com/tangibleai/community/mathtext@mainspacy==3.4.*pandas==1.5.*matplotlib==3.6.*pytest==7.2.*httpx==0.23.*django-environsupabase
44 unmodified lines4546474849505144 unmodified linesdf.to_csv("data/text2int_results.csv", index=False)acc_score = df["score"].mean().__round__(2)self.assertGreaterEqual(acc_score, 0.8, f"Accuracy score: '{acc_score}'. Value is too low!")if __name__ == '__main__':44 unmodified lines4546474849505144 unmodified linesdf.to_csv("data/text2int_results.csv", index=False)acc_score = df["score"].mean().__round__(2)self.assertGreaterEqual(acc_score, 0.5, f"Accuracy score: '{acc_score}'. Value is too low!")if __name__ == '__main__':
app.py+3-5
data/text2int_results.csvAdded+90
requirements.txt+7-7
tests/test_text2int.py+1-1