bongsoo / albert-small-kor-v1

huggingface.co
Total runs: 7
24-hour runs: 0
7-day runs: -1
30-day runs: 0
Model's Last Updated: December 12 2022
fill-mask

Introduction of albert-small-kor-v1

Model Details of albert-small-kor-v1

albert-small-kor-v1

Usage (HuggingFace Transformers)
MASK 예시
from transformers import AutoTokenizer, AutoModel, AlbertForMaskedLM
import torch
import torch.nn.functional as F
tokenizer = AutoTokenizer.from_pretrained('bongsoo/albert-small-kor-v1', do_lower_case=True)
model = AlbertForMaskedLM.from_pretrained('bongsoo/albert-small-kor-v1')
text = ['한국 수도는 [MASK] 이다', '프랑스 수도는 [MASK]이다', '충무공 이순신은 [MASK]에 최고의 장수였다']
tokenized_input = tokenizer(text, max_length=128, truncation=True, padding='max_length', return_tensors='pt')
outputs = model(**tokenized_input)
logits = outputs.logits
mask_idx_list = []
for tokens in tokenized_input['input_ids'].tolist():
    token_str = [tokenizer.convert_ids_to_tokens(s) for s in tokens]
    
    # **위 token_str리스트에서 [MASK] 인덱스를 구함
    # => **해당 [MASK] 안덱스 값 mask_idx 에서는 아래 출력하는데 사용됨
    mask_idx = token_str.index('[MASK]')
    mask_idx_list.append(mask_idx)
    
for idx, mask_idx in enumerate(mask_idx_list):
    
    logits_pred=torch.argmax(F.softmax(logits[idx]), dim=1)
    mask_logits_idx = int(logits_pred[mask_idx])
    # [MASK]에 해당하는 token 구함
    mask_logits_token = tokenizer.convert_ids_to_tokens(mask_logits_idx)
    # 결과 출력 
    print('\n')
    print('*Input: {}'.format(text[idx]))
    print('*[MASK] : {} ({})'.format(mask_logits_token, mask_logits_idx))
  • 결과
*Input: 한국 수도는 [MASK] 이다
*[MASK] : ▁서울 (80)

*Input: 프랑스 수도는 [MASK]이다
*[MASK] : ▁불과 (1682)

*Input: 충무공 이순신은 [MASK]에 최고의 장수였다
*[MASK] : ▁우리 (184)
Training

MLM(Masked Langeuage Model) 훈련

Model Config
{
  "architectures": [
    "AlbertForPreTraining"
  ],
  "attention_probs_dropout_prob": 0,
  "bos_token_id": 2,
  "classifier_dropout_prob": 0.1,
  "embedding_size": 128,
  "eos_token_id": 3,
  "hidden_act": "gelu_new",
  "hidden_dropout_prob": 0,
  "hidden_size": 768,
  "initializer_range": 0.02,
  "inner_group_num": 1,
  "intermediate_size": 3072,
  "layer_norm_eps": 1e-12,
  "max_position_embeddings": 512,
  "model_type": "albert",
  "num_attention_heads": 12,
  "num_hidden_groups": 1,
  "num_hidden_layers": 6,
  "pad_token_id": 0,
  "position_embedding_type": "absolute",
  "torch_dtype": "float32",
  "transformers_version": "4.21.2",
  "type_vocab_size": 2,
  "vocab_size": 30000
}
Citing & Authors

bongsoo

Runs of bongsoo albert-small-kor-v1 on huggingface.co

7
Total runs
0
24-hour runs
0
3-day runs
-1
7-day runs
0
30-day runs

More Information About albert-small-kor-v1 huggingface.co Model

More albert-small-kor-v1 license Visit here:

https://choosealicense.com/licenses/apache-2.0

albert-small-kor-v1 huggingface.co

albert-small-kor-v1 huggingface.co is an AI model on huggingface.co that provides albert-small-kor-v1's model effect (), which can be used instantly with this bongsoo albert-small-kor-v1 model. huggingface.co supports a free trial of the albert-small-kor-v1 model, and also provides paid use of the albert-small-kor-v1. Support call albert-small-kor-v1 model through api, including Node.js, Python, http.

albert-small-kor-v1 huggingface.co Url

https://huggingface.co/bongsoo/albert-small-kor-v1

bongsoo albert-small-kor-v1 online free

albert-small-kor-v1 huggingface.co is an online trial and call api platform, which integrates albert-small-kor-v1's modeling effects, including api services, and provides a free online trial of albert-small-kor-v1, you can try albert-small-kor-v1 online for free by clicking the link below.

bongsoo albert-small-kor-v1 online free url in huggingface.co:

https://huggingface.co/bongsoo/albert-small-kor-v1

albert-small-kor-v1 install

albert-small-kor-v1 is an open source model from GitHub that offers a free installation service, and any user can find albert-small-kor-v1 on GitHub to install. At the same time, huggingface.co provides the effect of albert-small-kor-v1 install, users can directly use albert-small-kor-v1 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

albert-small-kor-v1 install url in huggingface.co:

https://huggingface.co/bongsoo/albert-small-kor-v1

Url of albert-small-kor-v1

albert-small-kor-v1 huggingface.co Url

Provider of albert-small-kor-v1 huggingface.co

bongsoo
ORGANIZATIONS

Other API from bongsoo

huggingface.co

Total runs: 94
Run Growth: 3
Growth Rate: 3.19%
Updated:February 10 2023
huggingface.co

Total runs: 6
Run Growth: 1
Growth Rate: 16.67%
Updated:September 28 2022