Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM WB Parser

Wildberries review analyzer powered by Claude (Anthropic). Scrapes reviews from any WB product page, classifies each one with an LLM (sentiment, topics, problems, praises, fake detection), aggregates the results, generates AI insights, and produces a ready-to-send PDF report.

How it works

WB URL
  └─► parse reviews (aiohttp, async)
        └─► LLM classification per review (Claude Haiku, concurrent)
              ├─► sentiment: positive / neutral / negative
              ├─► sentiment_score: float
              ├─► problems / praises: list of strings
              ├─► main_topics: list of strings
              └─► is_fake_likely: bool
                    └─► aggregation + clustering (scikit-learn)
                          └─► AI insights (Claude Sonnet)
                                └─► PDF report (ReportLab + matplotlib)

All LLM calls are cached in SQLite — re-running on the same product skips already-classified reviews.

Models used

Task Model
Review classification claude-haiku-4-5
Insights generation claude-sonnet-4-6
Quote selection claude-haiku-4-5

Setup

pip install -r requirements.txt
cp .env.example .env
# paste your ANTHROPIC_API_KEY into .env

Usage

python main.py --url "https://www.wildberries.ru/catalog/12345678/detail.aspx"

Options

Flag Default Description
--url required WB product page URL
--output report.pdf output PDF path
--max-reviews 500 max reviews to fetch (WB cap: 1000)
--client-role селлер-конкурент changes tone of insights: селлер-конкурент or сам владелец товара

What the report contains

  • Sentiment distribution (positive / neutral / negative) with chart
  • Top-10 problems and praises extracted from reviews
  • Fake review percentage estimate
  • Sentiment dynamics by month
  • Topic distribution
  • AI-generated strategic insights tailored to the client role
  • Representative review quotes per topic

Project structure

├── main.py                  # CLI entrypoint
├── config.py                # models, concurrency limits, paths
├── cache.py                 # SQLite cache for LLM responses
├── parsers/
│   └── wildberries.py       # async WB scraper
├── llm/
│   ├── client.py            # Anthropic async client wrapper
│   ├── classifier.py        # per-review classification
│   ├── prompts.py           # prompt templates
│   └── quote_selector.py    # picks representative quotes
├── analytics/
│   ├── aggregator.py        # stats aggregation
│   ├── clustering.py        # topic clustering
│   └── insights.py          # AI insights generation
└── reporting/
    ├── pdf_builder.py        # assembles the PDF
    └── charts.py             # matplotlib charts

Requirements

  • Python 3.11+
  • Anthropic API key

About

Wildberries review analyzer: async scraper + Claude LLM classification + PDF report

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages