Implementation:ChenghaoMou Text dedup Report Launcher
| Knowledge Sources | |
|---|---|
| Domains | CLI, Reporting, Deduplication |
| Last Updated | 2026-02-14 21:00 GMT |
Overview
Concrete tool for launching the Gradio cluster visualization app with pre-configured settings from the text-dedup Config system.
Description
The main function in report/run.py serves as the CLI entry point that bridges the configuration-based deduplication pipeline with the interactive reporting UI. It accepts a Config object (parsed via pydantic-settings CLI), pre-populates the Gradio UI components (output directory, text column, cluster column, index column) with values from the config, and launches the Gradio server. When run as a script, it uses pydantic_settings.CliApp to parse command-line arguments into a Config object.
Usage
Use this entry point when you want to launch the cluster visualization app directly from the command line after completing a deduplication run, without manually entering the output directory and column names in the Gradio UI.
Code Reference
Source Location
- Repository: ChenghaoMou_Text_dedup
- File: report/run.py
- Lines: 1-33
Signature
def main(config: Config) -> None:
"""Launch Gradio app with pre-configured settings.
Args:
config: A text-dedup Config object containing output directory
and algorithm column settings.
"""
Import
from report.run import main
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| config | Config | Yes | text-dedup Config object with output.output_dir and algorithm column settings |
Outputs
| Name | Type | Description |
|---|---|---|
| Gradio server | None | Launches a Gradio web server (blocking call); returns None |
Usage Examples
Command Line Usage
# Launch with a TOML config file
python -m report.run --config_path configs/minhash.toml
# Launch with explicit arguments
python -m report.run --output.output_dir ./output --algorithm.text_column text
Programmatic Usage
from report.run import main
from text_dedup.config.base import Config
# Create config and launch
config = Config() # or load from TOML
main(config)