MegaHAL เป็นบอทการเรียนรู้
คุณสามารถเรียกใช้เป็นแอปพลิเคชันบรรทัดคำสั่ง หรือฝังไว้ในแอปพลิเคชันของคุณเอง และทำการเรียกผ่าน API แบบธรรมดาได้ ตัวอย่างเช่น ดูพื้นที่เก็บข้อมูลเซิร์ฟเวอร์ megahal ซึ่งช่วยให้คุณสามารถสนทนากับ MegaHAL ออนไลน์ได้
มันถูกสร้างขึ้นบน Sooth ซึ่งเป็นแบบจำลองการทำนายสุ่มอย่างง่าย
MegaHAL เวอร์ชันใหม่นี้เขียนขึ้นเพื่อเป็นการแสดงความเคารพต่อต้นฉบับ ซึ่งฉันเขียนเมื่อประมาณยี่สิบปีที่แล้ว เมื่อสิ่งเหล่านี้ดำเนินไป เวอร์ชัน Ruby จะมีขนาดเพียงเศษเสี้ยวของขนาดเวอร์ชัน C ดั้งเดิม
บันทึกที่เก่าแก่ที่สุดที่ฉันมีเกี่ยวกับ MegaHAL คือโพสต์ USENET ตั้งแต่วันที่ 30 เมษายน 1995 ซึ่งทำซ้ำที่ด้านล่างของ README นี้
การรัน MegaHAL เวอร์ชันบรรทัดคำสั่งนั้นง่ายดาย:
> gem install megahal
> megahal
+----------------------------------------------------------+
| |
| # # ###### #### ## # # ## # |
| ## ## # # # # # # # # # # |
| # ## # ##### # # # ###### # # # |
| # # # # ### ###### # # ###### # |
| # # # # # # # # # # # # |
| # # ###### #### # # # # # # ###### |
| |
| Type "/help" for options and "/quit" to terminate. |
+----------------------------------------------------------+
Greetings and salutations to thee and thine.
>
หากคุณพิมพ์ /help
ที่พร้อมท์ คุณจะพบเมนู:
1. cancel
2. reset
3. brain
4. train
5. load
6. save
7. ignore
8. quit
ทำการเลือกโดยพิมพ์หมายเลขหรือชื่อรายการเมนู:
cancel
: ย้อนกลับโดยไม่ทำการเลือกreset
: ล้างสมองของ MegaHAL คืนค่าให้เป็นกระดานชนวนว่างเปล่าbrain
: เลือกจากบุคลิกที่มีอยู่จำนวนหนึ่ง (ดูด้านล่าง)train
: ให้ไฟล์ข้อความธรรมดาแก่ MegaHAL เพื่อเรียนรู้load
: โหลดสมองที่บันทึกไว้ก่อนหน้านี้จากไฟล์save
: บันทึกสมอง MegaHAL ปัจจุบันลงในไฟล์ignore
: ป้องกัน MegaHAL จากการเรียนรู้จากการป้อนข้อมูลของผู้ใช้ นี่เป็นสิ่งที่ดีถ้าคุณต้องการแชทโดยไม่เกิดการเปลี่ยนแปลงในสมองquit
: ออกจาก MegaHAL ทันที โดยสูญเสียการเปลี่ยนแปลงที่ยังไม่ได้บันทึก หากคุณเลือกรายการเมนู brain
ด้านบน คุณจะเห็นรายการสมอง MegaHAL ที่มีอยู่แล้วให้เลือก:
cancel
: ย้อนกลับโดยไม่ทำการเลือกdefault
: บุคลิกภาพที่ใช้ในการแข่งขัน Loebner ปี 1998aliens
: บิชอปจากเอเลี่ยน!ferris
: คุณเฟอร์ริส บูลเลอร์เอง! บูลเลอร์! บูลเลอร์!pepys
: Samuel Pepys นำมาจากฟีด Twitter ของ @samuelpepyspulp
: Marsellus Wallace จาก Pulp Fiction!sherlock
: Sherlock Holmes พร้อมคำพูดที่นำมาจากหนังสือทั้งหมดstartrek
: ข้อมูลจาก Star Trek (ขอบคุณ mbaker)starwars
: Threepio จาก Star Wars Trilogy! นี่คือตัวอย่างบทสนทนาที่นำมาจากไฟล์ megahal.log
โดยตรง (ซึ่งเขียนทุกครั้งที่คุณโต้ตอบกับ MegaHAL):
(brain changed to sherlock holmes)
MH10: On the strange coincidences, the plannings, the cross-purposes, the wonderful chains of events, working through generations, and leading to the composition of a woman.
USER: Who are you?
MH10: You could never guess how I employed my morning, or what I ended by doing.
USER: Did you play a game?
MH10: Come, Watson, come! The game is afoot.
USER: How exciting!
MH10: Isn't it gorgeous! What do you think of it.
USER: I think it's great. What are we going to do?
MH10: I think, perhaps, it is simplicity itself.
USER: Tell me then.
MH10: Your statement is, I want you?
USER: Ummm... no.
MH10: Yes, certainly.
USER: I think you're confused.
MH10: I think that you have been too busy to think of it.
USER: Are you saying what I think you're saying?
MH10: You know how to look into it.
USER: So do you by the sound of it.
MH10: I have been of material assistance to me for fifty minutes.
USER: Is this non-stop double entendre?
MH10: More than that it is a great thing for me to be able to understand that I have ever listened.
USER: Let's go and do something. Or get a bite to eat.
MH10: That is interesting.
USER: Why?
MH10: Because there are fifty who can reason analytically.
USER: Name them.
MH10: My name is Sherlock Holmes.
USER: And who are the other forty-nine?
MH10: I want to ascertain.
USER: You mean that you don't know?
MH10: Light a cigar and let me see if I can do what you have told me I think that both inferences are permissible.
USER: Well, it's been interesting. I must leave.
MH10: No crime, but a very interesting statement.
USER: Goodbye.
MH10: You must get home instantly and act.
MegaHAL Stopped
Have a weird conversation with a computer
-----------------------------------------
Recently I added a feature to my home page allowing the user to "talk" to a
computer program of mine. The program was not written very intelligently, so
most of the time its replies consisted of incoherent babble.
Version 2 came and went, and now version 3 - MegaHAL - is ready for release.
The new features of the program are:-
* A second-order markov model is used, and it is doubly-linked. This
means that the computers sentences tend to be more grammatical.
* Punctuation is supported, which segments the sentences realistically.
* The reply given by the computer is based upon one of the words in
the input string. The word selected is one that maximises the ratio
(number of times since word was last used)/(number of times word has
appeared).
* The computers reply is generated from this keyword, and may be up to
100 words long. The reply is generated in such a way that it is
impossible to get stuck in infinite loops.
* The keyword used is highlighted in the reply.
Some example conversations are given below:-
USER: you are crazy
HAL: WE *ARE* WEIRD.
USER: What is the meaning of life oh wise one?
HAL: *LIFE* IS THE ROOM.
USER: this is not getting us very far
HAL: YES I AM *GETTING* BORED OF GLOBAL DOMINATION.
USER: I have no idea.
HAL: *NO* IT IS IN HEAVEN.
USER: Is it really?
HAL: YES *IT* IS.
USER: My name is Jason.
HAL: I THINK ALAN TURING WAS A GIRLIE, JUST LIKE *MY* DEAR MAMA
The last response was generated from a combination of a discussion
about Alan Turing, and Monty Python's Lumberjack Song. Surely this
must be a sign of intelligence ;^)
Have fun!
ลิขสิทธิ์ (c) 2018 เจสัน ฮัตเชนส์ ดู UNLICENSE สำหรับรายละเอียดเพิ่มเติม