TASK 03 ยท CODEALPHA JAVA INTERNSHIP Natural Language Processing Regex Intent Classification

AlphaBot AI Chatbot.

A Java conversational agent powered by pattern-based NLP, intent classification, memory persistence, and dynamic multi-response generation.

12+
Trained Intent Categories
Regex
Pattern Matching Engine
Memory
Session Persistence
<5ms
Instant Response Latency

Interactive AlphaBot Live Chat

Talk to AlphaBot in real-time. It runs the exact regex intent classification logic from the Java NLPEngine.java class.

AlphaBot ยท Java NLP v2.0 ONLINE
โ— Ready to assist
๐Ÿ‘‹ Hello! I am AlphaBot, an AI chatbot built in Java for the CodeAlpha internship by Nisha N.
Ask me questions, ask for math calculations, request a programming joke, or click any prompt below!

Official Video Walkthrough

Watch the full console conversation demonstrating natural dialogue, math evaluation, and intent recognition.

TASK 3.mp4

โ–ถ Task 3 Demonstration โ€” AlphaBot Chatbot In Action

Full HD Recording

System Architecture & Java NLP Design

Pattern-driven natural language processing using modular intent mapping and conversation memory persistence.

NLPEngine.java

Iterates through compiled regex patterns. When an intent matches, randomly samples from pre-defined contextual response variants.

Intent.java

Data structure binding an intent tag to a collection of regex patterns and corresponding bot response choices.

ChatMemory.java

Handles session history persistence to local disk (chat_memory.txt) for auditing and contextual recall.

Chatbot.java

The central controller orchestrating input normalization, command routing, formatting, and graceful termination.

Java 25 LTS
public class NLPEngine {
    private List<Intent> intents;

    public NLPEngine() {
        intents = new ArrayList<>();
        loadIntents();
    }

    public String processInput(String input) {
        for (Intent intent : intents) {
            if (intent.matches(input)) {
                return intent.getRandomResponse();
            }
        }
        return "I'm not quite sure I understand. Type 'help' to see what I can do!";
    }
}

How to Run Locally in Terminal

Start the interactive chat interface directly in your command shell.

Navigate into the project folder and launch with Java:

cd Task3_AIChatbot
javac *.java
java Chatbot
โ† Previous: Stock Trading Platform Next Project: Hotel Reservation System โ†’