##!pip install gingerit
from gingerit.gingerit import GingerIt
jd = []
for txt in list(data['Job Description']):
jd.append(GingerIt().parse(txt)['result'])
data['jd'] = jd
I want to correct the spelling and grammatical mistakes in a text feature/column in a pandas dataframe which has ~3000 rows. Each row contains 4-5 statements. So, I used GingerIt() from gingerit.gingerit and I am getting an error.
KeyError Traceback (most recent call last)
<ipython-input-25-ea5c757d88d2> in <module>()
5 jd = []
6 for txt in list(datajd['Job Description']):
---->7 jd.append(GingerIt().parse(txt)['result'])
/usr/local/lib/python3.7/dist-packages/gingerit/gingerit.py in parse(self, text, verify)
26 )
27 data = request.json()
---> 28 return self._process_data(text, data)
29
30 @staticmethod
/usr/local/lib/python3.7/dist-packages/gingerit/gingerit.py in _process_data(self, text, data)
38 corrections = []
39
---> 40 for suggestion in reversed(data["Corrections"]):
41 start = suggestion["From"]
42 end = suggestion["To"]
KeyError: 'Corrections'