serenayj / ABCD-ACL2021

ABCD: A Graph Framework to Convert Complex Sentences to a Covering Set of Simple Sentences
MIT License
28 stars 3 forks source link

Getting error while trying to test on my own data #6

Open zahrahosseini99 opened 2 years ago

zahrahosseini99 commented 2 years ago

Hi, I was trying to test and I followed your instruction carefully, but I got the follwing error while running python process_test.py: The sentence: Paytm started as a prepaid mobile and DTH recharge platform in August 2010 until it was launched into an e-commerce payment system and financial technology.

['started-2', 'Paytm-1', 'mobile-6', 'as-3', 'a-4', 'prepaid-5', 'DTH-8', 'and-7', 'recharge-9', 'platform-10', 'August-12', 'in-11', '2010-13', 'launched-17', 'until-14', 'it-15', 'was-16', 'system-22', 'into-18', 'an-19', 'e-', 'payment-21', 'technology-25', 'and-23', 'financial-24'] Traceback (most recent call last): File "C:\Users\hosse\Downloads\ABCD-ACL2021-main\ABCD-ACL2021-main\process_test.py", line 88, in <module> vtov, vtoi = wordict(words) File "C:\Users\hosse\Downloads\ABCD-ACL2021-main\ABCD-ACL2021-main\utils.py", line 27, in wordict words_srt = sorted(words, key=lambda x:int(x.split("-")[-1])) File "C:\Users\hosse\Downloads\ABCD-ACL2021-main\ABCD-ACL2021-main\utils.py", line 27, in <lambda> words_srt = sorted(words, key=lambda x:int(x.split("-")[-1])) ValueError: invalid literal for int() with base 10: ''

As you can see there is a 'e-' and it is the main problem. what should I do? I could fix it with some "if or whiles" but I think it is important to work correctly.

serenayj commented 2 years ago

Hi Zahra, sorry for the late reply. I wonder if you have solved this problem. if not, here is a quick solution: You could go through this list, find and modify any token that is missing the index number, e.g.: "e-" should indexed as 20, "e-20". The number could be inferred from other tokens. Let me know if this makes sense.