Git Product home page Git Product logo

sm-kornlp's Introduction

Korean NLP downstream tasks Hands-on Labs on Amazon SageMaker

Introduction

Hugging Face on Amazon SageMaker

텍스트 분석, 번역, 문장 요약, 엔티티 분류 등 자연어 처리의 AI/ML 적용 사례들이 매우 많지만, 여전히 많은 고객들이 기술적인 진입 장벽으로 도입에 어려움을 겪고 있습니다. 일부 분들은 이미 Hugging Face 트랜스포머 라이브러리와 SageMaker의 많은 예제 코드들로 AIML 적용을 가속화하고 있지만, 2021년 초까지는 SageMaker가 Hugging Face 전용 컨테이너를 네이티브하게 지원하지 않아 커스텀 스크립트와 커스텀 컨테이너를 따로 작성해야 하는 어려움이 있었습니다.

하지만, 최근 AWS는 Amazon SageMaker에서 Hugging Face의 트랜스포머 모델을 더 쉽게 훈련하고 배포할 수 있는 Hugging Face 딥러닝 훈련 컨테이너 및 추론 컨테이너를 도입했습니다. 따라서, 인프라 설정에 대한 고민 없이 몇 줄의 코드만으로(Low-code) 빠르게 자연어 처리 모델의 훈련 및 프로덕션 배포가 가능하게 되었습니다.

Korean Language Support

기술 성숙도가 낮거나 자연어 처리 모델을 검토하기 시작하는 분들은 한국어 핸즈온을 많이 찾습니다. 하지만, 한국어에 대한 핸즈온이 체계적으로 정리되어 있지 않아 도입에 많은 어려움을 겪는 것을 보아 왔고, 이에 따라 초심자들도 쉽게 시작할 수 있는 한국어 핸즈온을 개발하였습니다.

Hands-on Labs

각 핸즈온은 독립적으로 실행 가능합니다. 워크샵 진행 시 유즈케이스에 따라 자유롭게 핸즈온을 수행하시면 됩니다.

Multiclass Classification

Named Entity Recognition (NER)

Question Answering

Chatbot and Semantic Search using Sentence-BERT (SBERT)

Natural Language Inference (NLI)

Summarization

Translation

TrOCR


References

더 자세한 내용은 REFERENCES를 참조하세요.

Security

더 자세한 내용은 CONTRIBUTING를 참조하세요.

License

이 샘플 코드는 MIT-0 라이센스에 따라 제공됩니다. LICENSE 파일을 참조하십시오. 다만, 본 샘플 코드 외의 사전 훈련된 모델과 데이터셋은 각자의 라이센스를 따릅니다. 핸즈온 실습 목적이 아니라면 라이센스를 확인해 주세요.

sm-kornlp's People

Contributors

amazon-auto avatar daekeun-ml avatar hmkim avatar jminj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sm-kornlp's Issues

AttributeError: module 'torch.nn.init' has no attribute 'trunc_normal_'

model = VisionEncoderDecoderModel.from_pretrained(trocr_model)


AttributeError Traceback (most recent call last)
/tmp/ipykernel_27248/1443729722.py in
----> 1 model = VisionEncoderDecoderModel.from_pretrained(trocr_model)

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py in from_pretrained(cls, *args, **kwargs)
249 )
250 kwargs["_fast_init"] = False
--> 251 return super().from_pretrained(*args, **kwargs)
252
253 @classmethod

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
2226
2227 with ContextManagers(init_contexts):
-> 2228 model = cls(config, *model_args, **model_kwargs)
2229
2230 if load_in_8bit:

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/models/vision_encoder_decoder/modeling_vision_encoder_decoder.py in init(self, config, encoder, decoder)
187
188 if encoder is None:
--> 189 encoder = AutoModel.from_config(config.encoder)
190
191 if decoder is None:

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py in from_config(cls, config, **kwargs)
408 elif type(config) in cls._model_mapping.keys():
409 model_class = _get_model_class(config, cls._model_mapping)
--> 410 return model_class._from_config(config, **kwargs)
411
412 raise ValueError(

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/modeling_utils.py in _from_config(cls, config, **kwargs)
1017 model = cls(config, **kwargs)
1018 else:
-> 1019 model = cls(config, **kwargs)
1020
1021 # restore default dtype if it was modified

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/models/deit/modeling_deit.py in init(self, config, add_pooling_layer, use_mask_token)
465
466 # Initialize weights and apply final processing
--> 467 self.post_init()
468
469 def get_input_embeddings(self) -> DeiTPatchEmbeddings:

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/modeling_utils.py in post_init(self)
983 modules properly initialized (such as weight initialization).
984 """
--> 985 self.init_weights()
986 self._backward_compatibility_gradient_checkpointing()
987

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/modeling_utils.py in init_weights(self)
1435 if _init_weights:
1436 # Initialize weights
-> 1437 self.apply(self._init_weights)
1438
1439 # Tie weights should be skipped when not initializing all weights

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py in apply(self, fn)
287 """
288 for module in self.children():
--> 289 module.apply(fn)
290 fn(self)
291 return self

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py in apply(self, fn)
287 """
288 for module in self.children():
--> 289 module.apply(fn)
290 fn(self)
291 return self

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py in apply(self, fn)
287 """
288 for module in self.children():
--> 289 module.apply(fn)
290 fn(self)
291 return self

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py in apply(self, fn)
288 for module in self.children():
289 module.apply(fn)
--> 290 fn(self)
291 return self
292

~/anaconda3/envs/amazonei_pytorch_latest_p37/lib/python3.7/site-packages/transformers/models/deit/modeling_deit.py in init_weights(self, module)
403 """Initialize the weights"""
404 if isinstance(module, (nn.Linear, nn.Conv2d)):
--> 405 module.weight.data = nn.init.trunc_normal
(module.weight.data, mean=0.0, std=self.config.initializer_range)
406 if module.bias is not None:
407 module.bias.data.zero_()

AttributeError: module 'torch.nn.init' has no attribute 'trunc_normal_'

Needs an checking the version of torch.
Use the kernal with "conda_pytorch_p39".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.