SeanDaBlack / AbBOT

308 stars 55 forks source link

Dynamic tip text #26

Closed erikedlund closed 3 years ago

erikedlund commented 3 years ago

It would be nice to dynamically generate the body of the tip to make it harder to filter them out automatically. Tools like this GPT-2-based text generator could be useful. This one requires an API key (free to use but requires an account), but it does generate plausible text from a prompt, e.g.

>>> import requests
>>> r = requests.post(
...     "https://api.deepai.org/api/text-generator",
...     data={
...         'text': 'My neighbor got an illegal abortion.',
...     },
...     headers={'api-key': $MY_KEY'}
... )
>>> print(r.json())
{u'output': u'My neighbor got an illegal abortion. We think the sheriff might have given his daughter the abortion," he says. "You know, she said, \'OK, I\'ll do this for her.\' It did not work \u2014 \'cause I went to her and she went into rehab. I have a family. I\'ve been working for her all this time. But you know, I said to the sheriff when I got this, I said no. I said no I\'m not going to do an abortion. . . ." The idea of taking someone\'s life and burying those children beneath the earth with nothing to do with your choice is a common enough myth that even the most ardent opponent of abortion believes that there is actually some medical and religious reason to do so. The issue of abortion, as far as anyone is concerned, only has one major effect: It undermines an already weak federal government\'s role in regulating the practice of abortion. But what about the other, less prominent, effect of the law? The only problem in the rest of this story: It is, of course, a myth. In fact, the only legal solution is state law and order. As far as the law goes, that means the government can keep its hand off what remains of the fetus. Under the law though, women of any race can be raped and killed without any form of constitutional repercussion. As a matter of fact, a legal abortion is virtually "illegal" under Texas\' 1973 s. 3-2', u'id': u'd3d28729-1e09-40f4-adfe-d9d039a3b537'}
ramblingjordan commented 3 years ago

Adding comment from another issue to close duplicates:

From @jacobmovingfwd in #19 Check out Faker in python: https://github.com/joke2k/faker or JS: https://github.com/Marak/faker.js to dynamically generate names

erikedlund commented 3 years ago

@mtphil I just stubbed out a pretty hacky version of the text body generation in the above commit. It requires a free account at DeepAI and an environment variable with the API key to be set, so there is definitely room for refinement or an alternative solution!

jacobmovingfwd commented 3 years ago

i'm working on a faker version as I can as well.

ticet11 commented 3 years ago

I put together a list of phrases to tack on the end of the accusations that I was randomly choosing for each form. And was dynamically choosing a first name or first initial for the doctors.

ramblingjordan commented 3 years ago

We have moved active development to this repo: https://github.com/ramblingjordan/AbBOT-python

Could you recreate this issue and/or a pull request there?

Thanks!