hetpandya / textgenie Goto Github PK
View Code? Open in Web Editor NEWA python package to augment text data using NLP.
License: Apache License 2.0
A python package to augment text data using NLP.
License: Apache License 2.0
This repo and https://github.com/DanManN/pass2act/blob/master/pass2act.py contain the same exact code, and they're using Apache 2.0.
Looks like this may have changed in a new version of spacy. Created a pull request that might fix the issue.
The model can be downloaded via: python -m spacy download en_core_web_sm
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
en-core-web-sm 3.3.0 requires spacy<3.4.0,>=3.3.0.dev0, but you have spacy 2.2.4 which is incompatible.
I found a bug in grammar_utils.py
When i try this program:
1. textgenies = TextGenie("hetpandya/t5-small-tapaco", "bert-base-uncased")
2. sentence=["It is only to bring the case within the scope of Section a that such an allegation is made"]
3. textgenies.magic_lamp(sentence, "paraphrase: ", n_mask_predictions=15, n_paraphrase_predictions=15, paraphrase_top_k=5, convert_to_active=True)
An error occurs => TypeError: 'bool' object is not callable
The problem is line 173 in grammar_utils.py => xcomp = pass2act(xcomp,True).strip(" .")
a parameter is missing
Modified code: xcomp = pass2act(xcomp,nlp,True).strip(" .")
The program now works
from textgenie import TextGenie
textgenie = TextGenie("hetpandya/t5-small-tapaco", "bert-base-uncased")
sentences = [
"The video was posted on Facebook by Alex.",
"I plan to run it again this time",
]
x = textgenie.magic_lamp(
sentences, "paraphrase: ", n_mask_predictions=5, convert_to_active=True
)
print(x)
There seems to be a problem with active voice conversion. This is the code I'm running and this is the error:
Traceback (most recent call last): File "test2.py", line 11, in <module> sentences, "paraphrase: ", n_mask_predictions=5, convert_to_active=True File "\lib\site-packages\textgenie\textgenie.py", line 240, in magic_lamp convert_to_active, File "\lib\site-packages\textgenie\textgenie.py", line 136, in magic_once active_voice = self.convert_to_active(sent) File "\lib\site-packages\textgenie\textgenie.py", line 108, in convert_to_active if is_passive(sent): File "\lib\site-packages\textgenie\grammar_utils.py", line 280, in is_passive matcher.add("Passive", None, passive_rule) File "spacy\matcher\matcher.pyx", line 76, in spacy.matcher.matcher.Matcher.add TypeError: add() takes exactly 2 positional arguments (3 given)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.