Downloads · 30 days
0
denizbt/pan-style-analysis-models
pan-style-analysis-models is a text classification model from denizbt. Use it when you need a label for a piece of text. The card lists the license as mit.
These .pth files are state dictionaries of my custom defined BertStyleNN, which combines an encoder and sequence classification head. The models are fine-tuned from their titular model i.e. pan-style-analysis-models/r…
Downloads · 30 days
0
Access
Public
Updated May 25, 2025
Repo size
2.1 GB
Likes
0
Public
Click a slice to open those files.
.pth2.1 GB · 100%
From the Hugging Face model README
These .pth files are state dictionaries of my custom defined BertStyleNN, which combines an encoder and sequence classification head. The models are fine-tuned from their titular model i.e. pan-style-analysis-models/roberta-base.pth was fine-tuend using roberta-base as the encoder and my custom defined MLP StyleNN. The state dictionaries include the fine-tuned weights for both the encoder and FFNN which acts the sequence classification head (for binary classification). I call this encodr + sequence classification model, BertStyleNN. To use the state dictionaries, they must be loaded into a BertStyleNN.
These models are fine-tuned for multi-author style analysis on a dataset of sentence pairs; the training objective was to classify sentence pairs as either written by same author (0) or different authors (1). The PAN Multi-Author Style Analysis shared task data from 2025 was used for all models; it can be downloaded here (all three difficulty levels were combined to create the training set).
More information about BertStyleNN, including model architecture, logs, and training hyperparameters can be found in this repository.
Example downloading state dictionary for fine-tuned roberta-base to current directory.
from huggingface_hub import hf_hub_download
hf_hub_download(repo_id='denizbt/pan-style-analysis-models', filename='roberta-base.pth', local_dir='.')
Loading state dictionary into BertStleNN (import from this repo)
import torch
from models import BertStyleNN
device = "cuda" if torch.cuda.is_available() else "cpu"
# Create model instance
model_name = "roberta-base"
model = BertStyleNN(enc_model_name=model_name, use_sentence_transformers=False) # set use_sentence_transfomers to True if loading sentence-transformers model
state_dict_path = "TODO replace this with the location where you downloaded models from the HF hub"
# Load state dict and map to current device
state_dict = torch.load(state_dict_path, map_location=device)
model.load_state_dict(state_dict)
coming soon!
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->Deniz Boloni-Turgut ([email protected])