tenseflow
tenseflow copied to clipboard
"RuntimeError: generator raised StopIteration" from module pattern/text
I got past the previous error by giving in and installing MySQL (via homebrew.) Then I installed the SpaCy English model as directed. But basic CLI usage as in your example fails:
$ python3
Python 3.9.1 (default, Dec 17 2020, 03:56:09)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from tenseflow import change_tense
>>> change_tense('I will go to the store.', 'past')
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pattern/text/__init__.py", line 609, in _read
raise StopIteration
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/snej/Code/tenseflow/tenseflow/change_tense.py", line 116, in change_tense
out.append(conjugate(words[-1].text, tense=this_tense, person=person, number=number))
File "/usr/local/lib/python3.9/site-packages/pattern/text/__init__.py", line 2208, in conjugate
b = self.lemma(verb, parse=kwargs.get("parse", True))
File "/usr/local/lib/python3.9/site-packages/pattern/text/__init__.py", line 2172, in lemma
self.load()
File "/usr/local/lib/python3.9/site-packages/pattern/text/__init__.py", line 2127, in load
for v in _read(self._path):
RuntimeError: generator raised StopIteration
>>>
Same issue. Did you resolve it? @snej , @bendichter
git clone https://github.com/bendichter/tenseflow.git
I was getting the same issue, but cloning the repository first helped
There are still people using this? chatGPT would probably be easier and better
Huh? That’s like using a sledgehammer to crack open an walnut. (A sledgehammer you can’t even use yourself, you have to send the walnut to the cloud.)
Besides, there’s no assurance that if you tell ChatGPT “change the following text from third to first person…” that it won’t start confabulating and making its own random changes to the text. Especially if the text is long enough to exceed its token window.
That's all technically true, but I'd recommend at least trying it for your application. There are many nuances of this that my solution handles poorly.
I was able, with some hacking, to get it to a state where it converted large swathes of a novel-in-progress from 1st to 3rd person or vice versa. I had to proofread and fix some mistakes, but it was a big help.
That's great to hear!