Projects
03 / 04

Model and explanatory API · 2026

Bitcoin sentiment analysis

An experimental pipeline for an especially noisy signal: it turns text into semantic embeddings, combines two LightGBM ensembles and translates each classification into an explanation with visible confidence, signals and limitations.

01 / Overview

What it is and the problem it solves

A positive or negative label offers little value without explaining confidence, signals and model limitations.

Experimental educational project: it analyses one English Bitcoin-related message. It does not predict prices or provide financial advice.

02 / How it works

How the system works

  1. 01

    Message encoding with Sentence Transformers to obtain a semantic representation shared by the classifiers.

  2. 02

    Two LightGBM ensembles arranged as a two-stage decision, each with its own persisted and validated threshold.

  3. 03

    FastAPI serves the interface and API from the same service; models and embeddings load server-side and are never exposed to the browser.

  4. 04

    OpenAI can write the final explanation, with a deterministic local fallback available when the API is not configured.

03 / My contribution

What I did

I prepared the data, trained and compared the pipeline, optimized the validation threshold and exposed the model with FastAPI.

Main decisions

  • Separate validation and test before tuning the decision threshold.
  • Use Sentence Transformers embeddings and a LightGBM ensemble.
  • Communicate probability and limitations rather than present output as financial advice.

04 / Validation and outcome

How I checked the result

I separated validation and test before tuning thresholds. API tests cover health, runtime loading, decision branches and the no-OpenAI fallback. The container downloads the embedding model during build so Cloud Run does not depend on Hugging Face at startup.

Project outcome

  • Balanced test performance and a deployed web experience.
  • An API that pairs each inference with understandable context.

05 / Lessons learned

What I learned during development

The challenge was not displaying a label, but turning a probabilistic output into a responsible experience. The interface therefore separates experimental analysis from financial advice and states its limits explicitly.