File size: 2,544 Bytes
9569cdd
 
 
 
 
 
37e947b
 
 
 
3bcc821
37e947b
 
9569cdd
 
 
2f95709
aea73c0
215915e
aea73c0
215915e
aea73c0
215915e
aea73c0
215915e
 
 
 
 
 
 
aea73c0
215915e
aea73c0
215915e
 
aea73c0
215915e
aea73c0
215915e
aea73c0
215915e
 
 
 
 
aea73c0
215915e
aea73c0
215915e
 
aea73c0
76ad340
9569cdd
071f494
9569cdd
 
 
 
 
 
 
 
 
 
 
 
 
2f95709
9569cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- feature-extraction
- sentence-similarity
widget:
  source_sentence: "亚丝娜"
  sentences:
    - "火影忍者"
    - "Sword Art Online"
    - "结城明日奈"
    - "アスナ"

---

# ACGVoc2vec

结构为[sentence-transformers](https://github.com/UKPLab/sentence-transformers),使用其**distiluse-base-multilingual-cased-v2**预训练权重,以5e-5的学习率在动漫相关语句对数据集下进行微调,损失函数为MultipleNegativesRankingLoss。

数据集主要包括:

* Bangumi

  * 动画日文名-动画中文名
  * 动画日文名-简介
  * 动画中文名-简介
  * 动画中文名-标签
  * 动画日文名-角色
  * 动画中文名-角色
  * 声优日文名-声优中文名

* pixiv

  * 标签日文名-标签中文名
* AnimeList

  * 动画日文名-动画英文名

* 维基百科

  * 动画日文名-动画中文名
  * 动画日文名-动画英文名
  * 中英日详情页h2标题及其对应文本
  * 简介多语言对照(中日英)
  * 动画名-简介(中日英)  

* moegirl

  * 动画中文名的简介-简介
* 动画中文名+小标题-对应内容

在进行爬取,清洗,处理后得到8000w对文本对(还在持续增加),batchzise=80训练了20个epoch,使st的权重能够适应该问题空间,生成融合了领域知识的文本特征向量(体现为有关的文本距离更加接近,例如作品与登场人物,或者来自同一作品的登场人物)。

## Usage

Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:

```
pip install -U sentence-transformers
```

Then you can use the model like this:

```python
from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer('OysterQAQ/ACGVoc2vec')
embeddings = model.encode(sentences)
print(embeddings)
```


## Full Model Architecture

```
SentenceTransformer(
  (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: DistilBertModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
  (2): Dense({'in_features': 768, 'out_features': 512, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
)
```

## Citing & Authors

<!--- Describe where people can find more information -->