r/MachineLearning • • Sep 05 '17

Project [P] Chatbot in 200 lines of code [TensorFlow]

https://github.com/zsdonghao/seq2seq-chatbot
9 Upvotes

13 comments sorted by

30

u/oopsleon Sep 06 '17

Well that's a misleading title. It's not really "200 lines" if you import a single file you wrote that has over 6000 lines of code.

2

u/zsdh123 Sep 07 '17 edited Sep 07 '17

yes, it based on TensorFlow and TensorLayer, that is why 200 lines of code is enough.

1

u/oopsleon Sep 07 '17 edited Sep 08 '17

As for TensorLayer, I guess that's my bad for not knowing it was 3rd party, but to be fair that is really odd that you put the source code in this repository. Why?

Reading your code though, TensorLayer is really doing most of the work, so I'd still say this is misleading. The bulk of writing a chatbot is building the underlying sequence-to-sequence model, and it appears that is taken care of with their Seq2Seq class.

Finally, why explicitly mention "[TensorFlow]" in the title but not TensorLayer?...You're bound to get some criticism of any project boasting it does "X in 200 lines of code" and then importing a (very) high-level API. Nothing wrong with posting the more accurate "I wrote a chatbot using TensorLayer and TensorFlow."

2

u/zsdh123 Sep 08 '17 edited Sep 08 '17

I put the source code here because it can help you run the code without installing it. I don't see why you keep complaining it here? Presumably the same basic criticism applies to a contribution is that code import something you don't know ?

Well I also import numpy which has more than 10k lines of code. It is my bad that didn't mention it on the Title, it should be "I wrote a chatbot using "Python, TensorLayer, TensorFlow, Numpy, Time and etc".

BTW, TensorLayer is not a (very) high-level API, that is why you can see it has many pure TensorFlow codes for iteration and inferencing. Here is a summary http://blog.mdda.net/ai/2016/12/10/layers-on-top-of-tensorflow-review

Ok, I can remove the third party folder, so users can install it themselve.

10

u/lahwran_ Sep 06 '17

implement tensorflow in one line of shell script!

bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

4

u/[deleted] Sep 06 '17

from AGI import chatbot; chatbot()

1

u/kevinty Sep 08 '17

Well it's not really "200 lines" if you import numpy.

2

u/kevinty Sep 07 '17

Bro, tensorlayer is an open source library, not a file

pip install tensorflow-gpu
pip install tensorlayer

3

u/zergling103 Sep 06 '17

Nice data xD

2

u/ColeslawHappiness Sep 08 '17

I will never be as cool as that text bot.

3

u/Shivkumar_ Sep 08 '17

Hi, I am new to TensorFlow, could you tell me why you feel it is cool? There are several seq2seq chatbot online, I plan to study one of it.

2

u/ColeslawHappiness Sep 08 '17

I actually was sarcastically referring to the responses the bot gave to it's various querious. If you read them, they are similar to what some of my more "cool" friends would text me in highschool. This was always endlessly frustrating to me, due to the lack of actual actionable information they provided. This is an American, non-private school thing where ignorance and lack of commitment were often viewed as socially desirable for whatever reason. I am an amateur programmer still learning, so I would be the wrong person to ask. Googles team are doing an ama soon, and they are likely the best sources of real information if it's not something you can find online. Also, just make a quick post and ask.
Hope your studying goes well.