Bingsu/bigbird_ko_base-tsdae-specialty_corpus
sentence-transformers๋ก ํ์ต๋ bigbird ๋ชจ๋ธ: ์ ๋ ฅ ๋ฌธ์ฅ์ 256๋ฒกํฐ๋ก ๋ณํํฉ๋๋ค.
Aihub ์ ๋ฌธ๋ถ์ผ ๋ง๋ญ์น์ ๋ํด TSDAE๋ก ํ์ต๋์์ต๋๋ค.
Usage (Sentence-Transformers)
์ฌ์ฉ ์ ์ sentence-transformers๋ฅผ ์ค์นํ์ธ์.
pip install -U sentence-transformers
๋๋
conda install -c conda-forge sentence-transformers
์ฌ์ฉ ์์ :
from sentence_transformers import util
sent = [
"๋ณธ ๋
ผ๋ฌธ์ ๋์งํธ ์ ํธ์ฒ๋ฆฌ์ฉ VLSI์ ์๋์ค๊ณ๋ฅผ ์ํ SODAS-DSP(SOgang Design Automation System-DSP) ์์คํ
์ ์ค๊ณ์ ๊ฐ๋ฐ ๊ฒฐ๊ณผ์ ๋ํ์ฌ ๊ธฐ์ ํ๋ค",
"๋ณธ ๋
ผ๋ฌธ์์๋ DD-Gardner๋ฐฉ์์ ํ์ด๋ฐ ๊ฒ์ถ๊ธฐ ์ฑ๋ฅ์ ๊ณ ์ฐฐํ๋ค.",
"์ด๋ฌํ ํด์๋ฐฉ๋ฒ์ ๋งค์ฐ ๋ณต์กํ ๊ฒ์ด์ด์ ์์น ํด์ ํ๋ก๊ทธ๋จ์ด ํ์์ ์ด๋ค.",
"์์น ํด์ ํ๋ก๊ทธ๋จ์ ์ฌ๋ฌ ๊ฐ์ง ํ๊ฒฝ ๋ณ์๋ฅผ ์
๋ ฅํด์ผ ํ๋ฏ๋ก ์ผ๋ฐ์ธ์ด ์ฌ์ฉํ๊ธฐ์๋ ๋ง์ ์ด๋ ค์์ด ์๋ค.",
"๋ ์ฐ๋๊ณผ ํฌ๊ณผ์ ๋ํ ๊ณ ์ฃผํ ๊ทผ์ฌ์๋ ์ป์ด์ง๋ค.",
"๊ทธ๋ฆฌ๊ณ ์ฌ๋ฆฟ๊ฐ์ ๊ฐ๊ฒฉ์ ๋ณํ์ ์ํด์ ๋นํญ(beamwidth)์ ์กฐ์ ํ ์ ์์์ ๋ณด์ฌ์ค๋ค.",
"์ค๋ ์ ์ฌ์ ์ง์ฅ๋ฉด์ด๋ค.",
"์ค๋ ์ ๋
์ ๊น๋ฐฅ์ฒ๊ตญ์ด๋ค."
]
paraphrases = util.paraphrase_mining(model, sent)
for paraphrase in paraphrases[:5]:
score, i, j = paraphrase
print("{} \t\t {} \t\t Score: {:.4f}".format(sent[i], sent[j], score))
์ด๋ฌํ ํด์๋ฐฉ๋ฒ์ ๋งค์ฐ ๋ณต์กํ ๊ฒ์ด์ด์ ์์น ํด์ ํ๋ก๊ทธ๋จ์ด ํ์์ ์ด๋ค. ์์น ํด์ ํ๋ก๊ทธ๋จ์ ์ฌ๋ฌ ๊ฐ์ง ํ๊ฒฝ ๋ณ์๋ฅผ ์
๋ ฅํด์ผ ํ๋ฏ๋ก ์ผ๋ฐ์ธ์ด ์ฌ์ฉํ๊ธฐ์๋ ๋ง์ ์ด๋ ค์์ด ์๋ค. Score: 0.8990
์ค๋ ์ ์ฌ์ ์ง์ฅ๋ฉด์ด๋ค. ์ค๋ ์ ๋
์ ๊น๋ฐฅ์ฒ๊ตญ์ด๋ค. Score: 0.8945
์์น ํด์ ํ๋ก๊ทธ๋จ์ ์ฌ๋ฌ ๊ฐ์ง ํ๊ฒฝ ๋ณ์๋ฅผ ์
๋ ฅํด์ผ ํ๋ฏ๋ก ์ผ๋ฐ์ธ์ด ์ฌ์ฉํ๊ธฐ์๋ ๋ง์ ์ด๋ ค์์ด ์๋ค. ์ค๋ ์ ๋
์ ๊น๋ฐฅ์ฒ๊ตญ์ด๋ค. Score: 0.8901
๋ณธ ๋
ผ๋ฌธ์ ๋์งํธ ์ ํธ์ฒ๋ฆฌ์ฉ VLSI์ ์๋์ค๊ณ๋ฅผ ์ํ SODAS-DSP(SOgang Design Automation System-DSP) ์์คํ
์ ์ค๊ณ์ ๊ฐ๋ฐ ๊ฒฐ๊ณผ์ ๋ํ์ฌ ๊ธฐ์ ํ๋ค ๋ณธ ๋
ผ๋ฌธ์์๋ DD-Gardner๋ฐฉ์์ ํ์ด๋ฐ ๊ฒ์ถ๊ธฐ ์ฑ๋ฅ์ ๊ณ ์ฐฐํ๋ค. Score: 0.8894
๋ณธ ๋
ผ๋ฌธ์ ๋์งํธ ์ ํธ์ฒ๋ฆฌ์ฉ VLSI์ ์๋์ค๊ณ๋ฅผ ์ํ SODAS-DSP(SOgang Design Automation System-DSP) ์์คํ
์ ์ค๊ณ์ ๊ฐ๋ฐ ๊ฒฐ๊ณผ์ ๋ํ์ฌ ๊ธฐ์ ํ๋ค ๊ทธ๋ฆฌ๊ณ ์ฌ๋ฆฟ๊ฐ์ ๊ฐ๊ฒฉ์ ๋ณํ์ ์ํด์ ๋นํญ(beamwidth)์ ์กฐ์ ํ ์ ์์์ ๋ณด์ฌ์ค๋ค. Score: 0.8889
Usage (HuggingFace Transformers)
Without sentence-transformers, you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
from transformers import AutoTokenizer, AutoModel
import torch
def cls_pooling(model_output, attention_mask):
return model_output[0][:,0]
# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']
# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('Bingsu/bigbird_ko_base-tsdae-specialty_corpus')
model = AutoModel.from_pretrained('Bingsu/bigbird_ko_base-tsdae-specialty_corpus')
# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
# Compute token embeddings
with torch.no_grad():
model_output = model(**encoded_input)
# Perform pooling. In this case, cls pooling.
sentence_embeddings = cls_pooling(model_output, encoded_input['attention_mask'])
print("Sentence embeddings:")
print(sentence_embeddings)
Evaluation Results
For an automated evaluation of this model, see the Sentence Embeddings Benchmark: https://seb.sbert.net
Training
The model was trained with the parameters:
DataLoader:
torch.utils.data.dataloader.DataLoader of length 183287 with parameters:
{'batch_size': 8, 'sampler': 'torch.utils.data.sampler.RandomSampler', 'batch_sampler': 'torch.utils.data.sampler.BatchSampler'}
Loss:
sentence_transformers.losses.DenoisingAutoEncoderLoss.DenoisingAutoEncoderLoss
Parameters of the fit()-Method:
{
"epochs": 2,
"evaluation_steps": 10000,
"evaluator": "sentence_transformers.evaluation.EmbeddingSimilarityEvaluator.EmbeddingSimilarityEvaluator",
"max_grad_norm": 1,
"optimizer_class": "<class 'bitsandbytes.optim.adamw.AdamW8bit'>",
"optimizer_params": {
"lr": 3e-05
},
"scheduler": "warmupcosinewithhardrestarts",
"steps_per_epoch": null,
"warmup_steps": 10000,
"weight_decay": 0.005
}
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 1024, 'do_lower_case': False}) with Transformer model: BigBirdModel
(1): Pooling({'word_embedding_dimension': 256, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
)
Citing & Authors
- Downloads last month
- 1