Rekname commited on
Commit
8c48bcf
·
verified ·
1 Parent(s): d4667d7

Upload trained authorship attribution model (40 authors)

Browse files
.gitkeep ADDED
File without changes
README.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - ru
5
+ - en
6
+ tags:
7
+ - authorship-attribution
8
+ - stylometry
9
+ - text-classification
10
+ - scikit-learn
11
+ ---
12
+
13
+ # Authorship Attribution Model
14
+
15
+ Ensemble model for authorship attribution of literary texts (Russian + English).
16
+
17
+ ## Companion repository
18
+
19
+ Source code, training pipeline, and PyQt6 desktop application:
20
+ https://github.com/Rekname/authorship_attribution
21
+
22
+ ## Contents
23
+
24
+ - `classifier.joblib` — trained ensemble (SVM + Random Forest + Logistic Regression)
25
+ - `training_config.json` — training metrics and configuration
26
+ - `sentence_transformer/` — sentence-transformer assets used by the pipeline
27
+
28
+ ## Dataset
29
+
30
+ - 40 authors (Russian + English classical literature)
31
+ - ~3748 chunks of 800 words each
32
+ - 80/20 stratified train/test split, random_state=42
33
+
34
+ ## Usage
35
+
36
+ ```bash
37
+ # Download the whole folder
38
+ huggingface-cli download Rekname/authorship-attribution --local-dir models/
39
+
40
+ # Or with git
41
+ git clone https://huggingface.co/Rekname/authorship-attribution models/
42
+ ```
43
+
44
+ Then run the desktop application from the companion repo:
45
+
46
+ ```bash
47
+ git clone https://github.com/Rekname/authorship_attribution.git
48
+ cd authorship_attribution
49
+ uv sync
50
+ uv run python main.py
51
+ ```
52
+
53
+ ## Author
54
+
55
+ Малышко Александр Викторович, СДП-КБ-231, 3 курс, Кибербезопасность
56
+ ГрГУ им. Янки Купалы, 2026
classifier.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20a848a3c564dd46b8e696c898c17c7ab980ed03774b90a20dae874773e8cd3b
3
+ size 203619325
sentence_transformer/1_Pooling/config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false
7
+ }
sentence_transformer/README.md ADDED
File without changes
sentence_transformer/config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "old_models/paraphrase-multilingual-MiniLM-L12-v2/0_Transformer",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 384,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 1536,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "transformers_version": "4.7.0",
21
+ "type_vocab_size": 2,
22
+ "use_cache": true,
23
+ "vocab_size": 250037
24
+ }
sentence_transformer/config_sentence_transformers.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "2.0.0",
4
+ "transformers": "4.7.0",
5
+ "pytorch": "1.9.0+cu102"
6
+ }
7
+ }
sentence_transformer/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eaa086f0ffee582aeb45b36e34cdd1fe2d6de2bef61f8a559a1bbc9bd955917b
3
+ size 470641600
sentence_transformer/modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
sentence_transformer/sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 128,
3
+ "do_lower_case": false
4
+ }
sentence_transformer/special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
sentence_transformer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
sentence_transformer/tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"do_lower_case": true, "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "tokenize_chinese_chars": true, "strip_accents": null, "bos_token": "<s>", "eos_token": "</s>", "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "old_models/paraphrase-multilingual-MiniLM-L12-v2/0_Transformer", "tokenizer_class": "PreTrainedTokenizerFast"}
training_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "n_authors": 40,
3
+ "classifier_metrics": {
4
+ "svm": {
5
+ "train_accuracy": 0.9996664442961974,
6
+ "test_accuracy": 0.8333333333333334,
7
+ "display_name": "SVM"
8
+ },
9
+ "random_forest": {
10
+ "train_accuracy": 0.9996664442961974,
11
+ "test_accuracy": 0.7613333333333333,
12
+ "display_name": "Random Forest"
13
+ },
14
+ "logreg": {
15
+ "train_accuracy": 0.9996664442961974,
16
+ "test_accuracy": 0.8733333333333333,
17
+ "display_name": "Logistic Regression"
18
+ }
19
+ }
20
+ }