JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Hi.
Sorry, I know that there is a similar issue raised like the one here.
I saw your reply:
"Try it again. It seems there were no response data."
However, I kept trying it (rerunning the code) and the same error appears. I even tried reinstalling gingerit.
This is the error:
File "file_path", line 11, in process_grammar
result = self.parser.parse(text)['result']
File "file_path/venv/lib/python3.7/site-packages/gingerit/gingerit.py", line 27, in parse
data = request.json()
File "file_path/venv/lib/python3.7/site-packages/requests/models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "/opt/anaconda3/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/opt/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/opt/anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
And this is the source code:
from gingerit.gingerit import GingerIt
parser = GingerIt()
text = "I can also help take care of younger kids at playground. At playground, I can help my friend take care of the ball. I also like to help out and think about the feelings of others."
print(parser.parse(text)['result'])
Any help would be great. Thank you so much!
I am having the same issue. Is gingerit down for some reason?
I tried parsing the HTML and got this errors:
So cloudfare is messing something up? Please look into this.
i too have same issue. lemme know if anyone know how to fix it.
I am also facing the same issue. Please guys fix his issue. if anyone is able to fix it or have any solution the please mention me.
It was cloudflare antibot which was blocking request.
So you all can fix it by importing cloudscraper
and replacing line 16
session = requests.Session()
TO
session = cloudscraper.create_scraper()
In gingerit.py
it worked for me.
and i hope it works for you all too.
@BabyCodePvt @IvyTan29 @apatra9
@MythicalMAxX thank you so much, it worked for me!!
@MythicalMAxX Bro you saved the day. It worked. Thanks. I hope the PR gets approved soon.
{ "failure": false, "data": { "finalCorrectedString": " My name is Pawan what is your name", "mistakes": [ { "text": "my name is pawan what is your name.", "result": " My name is Pawan what is your name", "corrections": [ { "text": "m", "correct": "My", "definition": null }, { "text": "pawa", "correct": "Pawan", "definition": null } ] } ] } }
@MythicalMAxX After change it start working but did not getting the index parameter that come before changes, key name was "start" Now there is no key name start in the response.
i recommend you to check your file again because here's what i am getting
{'text': 'my name is pawan what is your name.', 'result': 'My name is Pawan what is your name.', 'corrections': [{'start': 11, 'text': 'pawan', 'correct': 'Pawan', 'definition': None}, {'start': 0, 'text': 'my', 'correct': 'My', 'definition': None}]}
cloudscraper only bypass bot detection and nothing else

check for start declaration in gingerit.py
keep me updated
@MythicalMAxX thanks it's working fine now. I have a query. can we use this library in big project where this library get thousand of request per second. or This library have some limitations.
@MythicalMAxX thanks it's working fine now. I have a query. can we use this library in big project where this library get thousand of request per second. or This library have some limitations.
I've integrated this library with telegram and it is working fine so i don't think there will be any problem with traffic but there is a limitation like you won't be able to use long paragraphs. I think there is a limit for alphabets you can use.
Alternatively, I was using gingerit in my python library but I decided to train my own model for sentence correction. Feel free to give me some feedback. I keep it updated by gathering more data and retraining the model.
import Caribe as cb
sentence = "I am lived with my parenmts "
correction = cb.t5_kes_corrector(sentence)
print(correction) # Output: I am living with my parents.
It was cloudflare antibot which was blocking request. So you all can fix it by importing cloudscraper and replacing line 16
session = requests.Session()TOsession = cloudscraper.create_scraper()In gingerit.py it worked for me. and i hope it works for you all too. @BabyCodePvt @IvyTan29 @apatra9
Not working for me in Google Colab
Hello Abhiram I don't have much experience with Google colab. I recommend you to check that you edited the right file. Or you can fork this repo, edit it and then install it instead. Hope this helps
It was cloudflare antibot which was blocking request. So you all can fix it by importing cloudscraper and replacing line 16
session = requests.Session()TOsession = cloudscraper.create_scraper()In gingerit.py it worked for me. and i hope it works for you all too. @BabyCodePvt @IvyTan29 @apatra9
Iam trying to create an API using GingerIt, I am using DETA to deploy this.how can I change this after I deploy this API?