本篇文章由 VeriMake 旧版论坛中备份出的原帖的 Markdown 源码生成
原帖标题为:写作机器人大战作文批改 AI —— 英文版狗屁不通生成器
原帖网址为:https://verimake.com/topics/241 (旧版论坛网址,已失效)
原帖作者为:karb0n(旧版论坛 id = 39,注册于 2020-05-04 19:27:42)
原帖由作者初次发表于 2021-06-27 15:15:05,最后编辑于 2021-06-27 15:15:05(编辑时间可能不准确)
截至 2021-12-18 14:27:30 备份数据库时,原帖已获得 590 次浏览、0 个点赞、0 条回复
写作机器人大战作文批改AI —— 英文版狗屁不通生成器
*“If you want to know the definitions, look them up yourself. And I've shown some examples to make them clearer. With the development of science and technology, more and more people begin worrying about Bullshit Generator (English Version). There is a need for further investigation. In recent years, Bullshit Generator (English Version) has caused a heated debate on. Johann Wolfgang von Goethe proposed that, the important thing in life is to have a great aim, and the determination to attain it. As far as I am concerned, I agree with the latter opinion to some extent. It is high time that something were done upon it. These days we often hear that Bullshit Generator (English Version). Attitudes toward Bullshit Generator (English Version) vary from person to person.” *
<p align="right">--- An Ancient Proverb of Mars</p>
即,能够生成一篇狗屁不通的英文文章。
原作为:https://github.com/menzi11/BullshitGenerator
本贴版本的代码:@karb0n
本贴代码的视频:@东
https://www.bilibili.com/video/BV1i5411T7ka
下边的代码的使用方式:修改 xx
变量可以修改文章主题,修改 最大词数
和 重复度
能分别修改最大词数和重复度,设定好之后直接运行即可打印出生成的文章。
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os, re
import random
data = {
"famous":["Joseph Addison 甲, a contented mind is the greatest blessing a man can enjoy in this world. 乙",
"Benjamin Franklin 甲, if you would know the value of money, go and try to borrow some. 乙",
"Thomas Edison 甲, if you wish to succeed, you should use persistence as your good friend, experience as your reference, prudence as your brother and hope as your sentry. 乙",
"Samuel Johnson 甲, health is certainly more valuable than money,because it is by health that money is procured. 乙",
"Henry David Thoreau 甲, that man is the richest whose pleasure are the cheapest. 乙",
"Albert Einstein 甲, sometimes one pays most for the things one gets for nothing. 乙",
"Louis Pasteur 甲, will, work and wait are the pyramidal cornerstones for success. 乙",
"Voltaire 甲, all the splendor in the world is not worth a good friend. 乙",
"William Hazlitt 甲, there is a great different between exposure of the mind and that of the body. 乙",
"Robert Louis Stevenson 甲, to travel hopefully is a better thing than to arrive, and the true success is to labor. 乙",
"Thomas Hardy 甲, I might say that success is won by three things: first, effort; second, more effort; third, still more effort. 乙",
"Charles Chaplin 甲, you have to believe in yourself. That's the secret of success. 乙",
"Bonapart Napoleon 甲, the man who has made up his mind to win will never say “impossible”. 乙",
"Richard Nixon 甲, our destiny offers not the cup of despair, but the chalice of opportunity. 乙",
"G. Eliot 甲, it never will rain roses. When we want to have more roses we must plant trees. 乙",
"Samuel Johnson 甲, great works are performed not by strength, but by perseverance. 乙",
"W.M. Thackeray 甲, dare and the world always yields. If it beats you sometimes, dare it again and again and it will succumb. 乙",
"Johann Wolfgang von Goethe 甲, the important thing in life is to have a great aim, and the determination to attain it. 乙",
"Ibsen 甲, if you doubt yourself, then indeed you stand on shaky ground. 乙",
"Leo Tolstory 甲, ideal is the beacon. Without ideal, there is no secure direction; without direction, there is no life. 乙",
"Mark Twain 甲, don't part with your illusions. When they are gone you may still exist, but you have ceased to live. 乙",
"Willian Shakespeare 甲, do not, for one repulse, give up the purpose that you resolved to effect. 乙",
"Thomas Stearns Eliot 甲, between the ideal and the reality. Between the motion and the act, Fall the shadow. 乙",
"Jane Austen 甲, a large income is the best recipe for happiness I ever heard of. 乙",
"Jane Austen 甲, happiness in marriage is entirely a matter of chance.",
"Francis Bacon 甲, live to learn, not learn to live. 乙",
"Steve Jobs 甲, stay hungry, stay foolish. 乙",
"Ernest Hemingway 甲, a man can be destroyed but not defeated. 乙",
"Schiller 甲, he who has done his best for his own time has lived for all times. 乙"],
"before":["pointed out that",
"said that",
"proposed that"],
"after":["As far as I am concerned, I agree with the latter opinion to some extent.",
"In a word, the whole society should pay close attention to the problem of it.",
"If we can not take useful means, we may not control this trend, and some undesirable result may come out unexpectedly.",
"I have a thousand words to say after reading this.",
"I realize that what we ought to do and the rest not.",
"We should realize who we are and what we want to be, from the this."],
"bosh":["Nowadays, there are more and more 丙 in some big cities.",
"Why have there been so many 丙? Maybe the reasons can be listed as follows.",
"In recent years, 丙 has caused a heated debate on.",
"It is high time that something were done upon it.",
"Why does such circumstance like 丙 occur in spite of social protection?",
"To solve the problem of 丙 is not easy at all, but is worth trying.",
"These days we often hear that 丙.",
"With the development of science and technology, more and more people begin worrying about 丙.",
"Attitudes toward 丙 vary from person to person.",
"People may have different opinions on 丙.",
"There is a need for further investigation.",
"If you want to know the definitions, look them up yourself. And I've shown some examples to make them clearer.",
"But it's well known that the opinion concerning this hot topic varies from person to person."]
}
名人名言 = data["famous"] # a 代表前面垫话,b代表后面垫话
前面垫话 = data["before"] # 在名人名言前面弄点废话
后面垫话 = data['after'] # 在名人名言后面弄点废话
废话 = data['bosh'] # 代表文章主要废话来源
xx = "eating fried chicken" # 在这里输入文章主题
最大词数 = 250
重复度 = 2
def 洗牌遍历(列表):
global 重复度
池 = list(列表) * 重复度
while True:
random.shuffle(池)
for 元素 in 池:
yield 元素
下一句废话 = 洗牌遍历(废话)
下一句名人名言 = 洗牌遍历(名人名言)
def 来点名人名言():
global 下一句名人名言
xx = next(下一句名人名言)
xx = xx.replace("甲",random.choice(前面垫话) )
xx = xx.replace("乙",random.choice(后面垫话) )
return xx
def 另起一段():
xx = "\r\n"
return xx
if __name__ == "__main__":
print("主题:" + xx)
tmp = ""
while (tmp.count(" ") <= 最大词数):
分支 = random.randint(0, 100)
if 分支 < 20 and len(tmp) > 0:
if tmp[-1] != '\n':
tmp += 另起一段()
elif 分支 < 40 :
tmp += 来点名人名言() + " "
else:
tmp += next(下一句废话) + " "
tmp = tmp.replace("丙",xx)
print(tmp)
```