Short Text Analysis is a Java-based pipeline for processing and classifying short text content (for example, tweets). The project combines text preprocessing, feature extraction, dataset preparation, and machine-learning classification to support quick experimentation on short-message datasets.
At a high level, the application helps you:
- Clean and normalize raw short-text inputs
- Compute features used for model training/inference
- Convert processed data into ML-friendly ARFF format
- Train/evaluate classification models (Weka-based)
- Integrate data from files and SQL-backed sources where needed
The repository implements an end-to-end short-text classification workflow:
- Input ingestion from local files and/or database-connected sources
- Text preprocessing (token cleanup, normalization, and preparation)
- Feature extraction from cleaned text records
- ARFF dataset generation for Weka consumption
- Model execution and evaluation through Weka-related classes
- Output artifacts such as prepared datasets, model results, and evaluation summaries
This structure is useful for experimentation, baseline model comparisons, and extending short-text analytics pipelines.
If you are new to the codebase, read files in this order:
-
Main- Entry point/orchestrator for pipeline execution.
- Wires together preprocessing, feature extraction, data conversion, and model operations.
-
TweetProcess- Core text-processing stage.
- Responsible for preparing raw tweet/short-text content for downstream feature computation.
-
FeatureExtract- Computes the engineered features used by classifiers.
- Defines what information from each short text becomes model input.
-
MakeARFF- Converts processed examples + features into ARFF format.
- Acts as the bridge from internal data structures to Weka-compatible datasets.
-
Weka-related classes
- Train, evaluate, and potentially persist/compare models.
- Encapsulate classifier choice, metrics, and evaluation flow.
-
Data integration helpers (
ExcelToDB, SQL/JDBC classes)- Import/export and storage integration points.
- Useful when data preparation and experiments involve database-backed workflows.
When making changes, start at Main to see control flow, then inspect each layer implementation.
The project is organized in a practical layered style:
-
Orchestration layer:
Main- Controls execution order and high-level workflow.
-
Processing layer:
TweetProcess- Handles short-text cleanup and normalization logic.
-
Feature layer:
FeatureExtract- Produces model-relevant numeric/categorical signals.
-
Data preparation layer:
MakeARFF- Builds Weka-ready ARFF datasets.
-
Model layer: Weka classes
- Runs training/inference and computes evaluation metrics.
-
Integration layer:
ExcelToDB, SQL helpers- Connects external data sources/sinks to the analysis pipeline.
Raw short text -> Preprocessing -> Feature extraction -> ARFF conversion -> Weka classification/evaluation -> Results
- Java (core language/runtime)
- Weka APIs for machine-learning models and evaluation
- JDBC/SQL APIs for database integration
- File I/O for dataset ingestion and artifact output
- JDK 8+ (or the version used by your team)
- Build tooling available in this repo context (IDE/manual javac flow)
- Weka library/JAR configured in classpath
- Access to any required input files and (if used) SQL database credentials
- Clone the repository.
- Import/open as a Java project in your IDE.
- Ensure Weka and JDBC dependencies are resolvable in classpath.
- Confirm input data locations and database configuration (if applicable).
- Run the
Mainclass. - Inspect generated ARFF files, model outputs, and evaluation results.
- Short-text/tweet records (file or DB sourced)
- Optional metadata/labels needed for supervised training
- Processed text representations
- Feature-enriched datasets
- ARFF files
- Classification/evaluation summaries
- Trace one complete run through
Mainbefore changing logic. - Make small, layer-scoped changes (processing vs feature vs model).
- Validate intermediate artifacts (especially ARFF structure) after edits.
- Update this README when behavior, architecture, or setup steps change.
To keep project documentation useful, every PR should preserve and update this README when needed.
- Project overview and purpose
- Execution/getting-started instructions
- Code walkthrough of key classes
- Technical architecture and data flow
- Dependencies/integration requirements
- Inputs/outputs and expected artifacts
Before requesting review, confirm:
- Behavior changes are reflected in Project Overview or What the Application Does
- New/modified classes are reflected in Code Walkthrough
- Architecture/data flow updates are reflected in Technical Overview
- Setup/runtime dependency changes are reflected in Getting Started
- New required configs, inputs, or outputs are documented
If a code change affects how the system runs or is understood, README updates are required in the same PR.