Downloads · 30 days
14
6% of all-time downloads
anonymous15135/nsp-councilseg
nsp-councilseg is a machine learning model from anonymous15135. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-nc-nd-4.0.
NSP-CouncilSeg is a fine-tuned BERT model specialized in Text Segmentation for municipal council meeting minutes. The model uses Next Sentence Prediction (NSP) to identify topic boundaries in long-form documents, maki…
Downloads · 30 days
14
6% of all-time downloads
All-time downloads
232
Public
Parameters
109M
436 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors436 MB · 100%
From the Hugging Face model README
NSP-CouncilSeg is a fine-tuned BERT model specialized in Text Segmentation for municipal council meeting minutes. The model uses Next Sentence Prediction (NSP) to identify topic boundaries in long-form documents, making it particularly effective for segmenting administrative and governmental meeting minutes.
Try out the model: Hugging Face Space Demo
neuralmind/bert-base-portuguese-casedThe model predicts whether two consecutive sentences belong to the same topic (label 0: "is_next") or represent a topic transition (label 1: "not_next"). By applying this classifier sequentially across all sentence pairs in a document, it identifies topic boundaries.
Sentence A: "Pelo Senhor Presidente foi presente a reunião a ata n.º 28 de 20.12.2023."
Sentence B: "Ponderado e analisado o assunto o Executivo Municipal deliberou por unanimidade aprovar a ata n.º 28 de 20.12.2023."
→ Prediction: Same Topic (confidence: 76%)
Sentence A: "Ponderado e analisado o assunto o Executivo Municipal deliberou por unanimidade aprovar a ata n.º 28 de 20.12.2023."
Sentence B: "Não houve processos e requerimentos diversos a apresentar."
→ Prediction: Topic Boundary (confidence: 82%)
from transformers import AutoTokenizer, AutoModelForNextSentencePrediction
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("anonymous15135/nsp-councilseg")
model = AutoModelForNextSentencePrediction.from_pretrained("anonymous15135/nsp-councilseg")
# Prepare input
sentence_a = "Pelo Senhor Presidente foi presente a reunião a ata n.º 28 de 20.12.2023."
sentence_b = "Ponderado e analisado o assunto o Executivo Municipal deliberou por unanimidade aprovar a ata n.º 28 de 20.12.2023."
# Tokenize
inputs = tokenizer(sentence_a, sentence_b, return_tensors="pt")
# Predict
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probs = torch.softmax(logits, dim=1)
# Interpret results
is_next_prob = probs[0][0].item()
not_next_prob = probs[0][1].item()
print(f"Is Next (same topic): {is_next_prob:.3f}")
print(f"Not Next (topic boundary): {not_next_prob:.3f}")
if not_next_prob > 0.5:
print("🔴 Topic boundary detected!")
else:
print("🟢 Same topic continues")
For questions or feedback, please open an issue in the model repository.
This model is released under the Attribution-NonCommercial-NoDerivatives 4.0 International