CoolFace
Modelpublic

itsjhuang/watsonx-docs-type-classifier

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes
Model Card

Watsonx Docs Document Type Classifier

Binary classifier for IBM Watsonx technical documentation pages. Given a documentation page, the model predicts whether it is:

  • conceptual (0): primarily used to understand or look up information
  • how-to (1): primarily used to complete a procedure or fix a problem

Model Details

Base embeddingssentence-transformers/all-MiniLM-L6-v2
ClassifierLinearSVC (C=1.0, max_iter=2000)
Training datasetitsjhuang/watsonx-docs-document-type
Inputtitle + first 800 words of document
Outputconceptual or how-to

Evaluation Results

Three conditions were trained and evaluated. The best model (B) was selected by test macro F1.

ConditionEmbedding ModelClassifierTrain AccTrain F1Test AccTest F1
Aall-MiniLM-L6-v2Logistic Regression0.8790.8790.8170.817
B ✅all-MiniLM-L6-v2LinearSVC0.9710.9710.8670.867
Cbge-small-en-v1.5Logistic Regression0.8640.8640.8330.833

Confusion matrices for each condition are available in the repository files.

Usage

python
import joblib
import numpy as np
from sentence_transformers import SentenceTransformer

embedder = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
clf = joblib.load("best_model.joblib")

def softmax(x):
    e = np.exp(x - np.max(x))
    return e / e.sum()

def predict(text):
    embedding = embedder.encode([text], convert_to_numpy=True)
    scores = clf.decision_function(embedding)[0]
    if np.ndim(scores) == 0:
        scores = np.array([-scores, scores])
    probs = softmax(scores)
    labels = ["conceptual", "how-to"]
    return dict(zip(labels, probs))

Limitations

  • Trained on IBM Watsonx documentation only; may not generalize to other technical documentation domains.
  • Label boundary between weak procedural pages and conceptual capability descriptions remains a residual source of error.

Source Dataset

Derived from `ibm-research/watsonxDocsQA`, licensed under Apache 2.0.