malteos/scincl-SciNCL SciNCL is a pre-tr...
malteos/scincl-SciNCL SciNCL is a pre-tr...并不只看表面做法,关键还要理解相关条件、限制和后续影响。
SciNCL
SciNCL is a pre-trained BERT language model to generate document-level embeddings of research papers.
It uses the citation graph neighborhood to generate samples for contrastive learning.
Prior to the contrastive training, the model is initialized with weights from scibert-scivocab-uncased.
The underlying citation embeddings are trained on the S2ORC citation graph.
Paper: Neighborhood Contrastive Learning for Scientific Document Representations with Citation Embeddings (EMNLP 2022 paper).
Code: https://github.com/malteos/scincl
PubMedNCL: Working with biomedical papers? Try PubMedNCL.
How to use the pretrained model
from transformers import AutoTokenizer, AutoModel
# load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained('malteos/scincl')
model = AutoModel.from_pretrained('malteos/scincl')
papers = [{'title': 'BERT', 'abstract': 'We introduce a new language representation model called BERT'},
{'title': 'Attention is all you need', 'abstract': ' The dominant sequence transduction models are based on complex recurrent or convolutional neural networks'}]
# concatenate title and abstract with [SEP] token
title_abs = [d['title'] + tokenizer.sep_token + (d.get('abstract') or '') for d in papers]
# preprocess the input
inputs = tokenizer(title_abs, padding=True, truncation=True, return_tensors="pt", max_length=512)
# inference
result = model(inputs)
# take the first token ([CLS] token) in the batch as the embedding
embeddings = result.last_hidden_state[:, 0, :]
Triplet Mining Parameters
| Setting | Value |
|---|---|
| seed | 4 |
| triples_per_query | 5 |
| easy_positives_count | 5 |
| easy_positives_strategy | 5 |
| easy_positives_k | 20-25 |
| easy_negatives_count | 3 |
| easy_negatives_strategy | random_without_knn |
| hard_negatives_count | 2 |
| hard_negatives_strategy | knn |
| hard_negatives_k | 3998-4000 |
malteos/scincl官网入口:https://huggingface.co/malteos/scincl
-
08.08
开局负债我摆摊烧烤手游上线时间揭晓开局负债我摆摊烧烤手游正式开服日期
-
08.08
文字经营酒店手游如何玩文字经营酒店手游核心玩法与新手入门指南
-
08.08
梅花万物皆数手游怎么玩梅花万物皆数新手入门与基础玩法详细说明
-
08.08
领主契约职业加点攻略领主契约各职业属性加点推荐与实战解析
-
08.08
拳王模拟器草根拳王上线时间拳王模拟器草根拳王版本更新与开服日期一览
-
08.08
忘却前夜唤醒体觉醒方法详细说明忘却前夜角色机制与养成指南
-
- LearnifyAI: 用AI帮我们学起来
- 08.08
-
- 美食大乱斗什么是T0阵容
- 08.08
-
- 梦想世界3巫法技能有哪些
- 08.08
-
- 龙腾传奇系统如何介绍
- 08.08
-
- 鸣潮莫宁如何全方位培养
- 08.08
-
- 冒险之星坦克如何玩
- 08.08
-
-
下载
- |
-
-
下载
- 《行尸走肉第一章》免安装中文汉化硬盘版下载
- 单机|436 MB
- 一款以动作冒险为主题的游戏
-
-
下载
- 《街头霸王X铁拳》免安装中文汉化硬盘版下载
- 单机|111MB
- 一款非常好玩的格斗游戏
-
-
下载
- |
-
-
下载
- 《暗黑破坏神3》免安装繁体中文正式版下载
- 单机|7630 MB
- 一款以角色扮演为主题的游戏
-
-
下载
- 《马克思佩恩3》免安装硬盘版下载
- 单机|27033 MB
- 一款以第三人称射击为主题的游戏