Package org.cis1200

Class ChatterBotMain

java.lang.Object
org.cis1200.ChatterBotMain

public class ChatterBotMain extends Object
This is the class where everything you've worked on comes together! You can see that we've provided a path to a CSV file of posts and the column from which they can be extracted. When run as an application, this program builds a Markov Chain from the training data in the CSV file, generates 10 random posts, and prints them to the terminal.

There is nothing for you to do in this file -- it already contains the code necessary to put your ChatterBot to work.

When run on the data from the illustrative_example.csv, we get output that looks like:

 a table and a banana! and a chair
 a table and a banana! and a banana! and a table and a chair
 a chair
 a chair
 a banana! and a table and a banana! and a banana! and a banana! and a banana! and a banana?
 a table and a banana?
 a banana?
 a table and a chair
 a chair
 a table and a banana! and a table and a chair*
 

When run on more realistic data from factretreiver_posts.csv, we get witticisms like * the following (among much junkier random outputs): *

  * Octopuses can have belly buttons.
  * Sometimes a seed pods look like.
  * Tigers cannot breathe through their mouth.
  * The average of expensive material is called Chicken Feed.
  * Dogs are more efficient fliers than about his followers!
  * Humans can remember ditching school
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
    File to store generated posts
    (package private) static final String
    This is a path to the CSV file containing the posts.
    (package private) static final int
    Column in the PATH_TO_POSTS CSV file to read posts from
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    Prints ten generated posts to the console so that you can see how your bot is performing!

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PATH_TO_POSTS

      static final String PATH_TO_POSTS
      This is a path to the CSV file containing the posts. The main method below uses the posts in this file when calling ChatterBot. If you want to run the ChatterBot on the other files we provide, change this path to a different file. (You may need to adjust the POST_COLUMN too.)
      See Also:
    • POST_COLUMN

      static final int POST_COLUMN
      Column in the PATH_TO_POSTS CSV file to read posts from
      See Also:
    • PATH_TO_OUTPUT_POSTS

      static final String PATH_TO_OUTPUT_POSTS
      File to store generated posts
      See Also:
  • Constructor Details

    • ChatterBotMain

      public ChatterBotMain()
  • Method Details

    • main

      public static void main(String[] args)
      Prints ten generated posts to the console so that you can see how your bot is performing!