An intelligent, console-based Java Chatbot utilizing rule-based NLP, string processing, and a modular architecture. Built with Java 17 and Object-Oriented Programming principles.
- Smart Greetings: Asks for your name and remembers it throughout the conversation.
- Rule-Based NLP: Cleans up your input and extracts intents using Regular Expressions (Regex).
- Dynamic Responses:
- Randomly selects from multiple greetings/goodbyes so it doesn't sound robotic.
- Fetches live Date & Time.
- Guesses a fun, random weather condition.
- FAQ Handling: Answers questions about its identity and creator.
- Persistent Conversation History: Logs every single chat session (and all messages) to
history/chat_log.txtusing Java File I/O.
Main.java: Entry point.ChatBot.java: Orchestrates the main conversation loop.NLPProcessor.java: Cleans text and matches keywords to Intents (e.g.,datetime,weather,greeting).ResponseEngine.java: Stores static responses in aHashMapand generates dynamic responses.ConversationHistory.java: UsesBufferedWriterto securely append logs to a text file.
- Open your terminal and navigate to the project's root folder
Task3. - Move into the
srcdirectory:cd src - Compile the Java files:
javac bot/*.java - Run the chatbot:
java bot.Main
Check out the history/ folder after chatting to see your saved conversation logs!