반응형
블로그 이미지
개발자로서 현장에서 일하면서 새로 접하는 기술들이나 알게된 정보 등을 정리하기 위한 블로그입니다. 운 좋게 미국에서 큰 회사들의 프로젝트에서 컬설턴트로 일하고 있어서 새로운 기술들을 접할 기회가 많이 있습니다. 미국의 IT 프로젝트에서 사용되는 툴들에 대해 많은 분들과 정보를 공유하고 싶습니다.
솔웅

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

카테고리


반응형

https://huggingface.co/learn/nlp-course/chapter4/4?fw=pt

 

Building a model card - Hugging Face NLP Course

2. Using 🤗 Transformers 3. Fine-tuning a pretrained model 4. Sharing models and tokenizers 5. The 🤗 Datasets library 6. The 🤗 Tokenizers library 9. Building and sharing demos new

huggingface.co

 

 

 

Building a model card

 

The model card is a file which is arguably as important as the model and tokenizer files in a model repository. It is the central definition of the model, ensuring reusability by fellow community members and reproducibility of results, and providing a platform on which other members may build their artifacts.

 

모델 카드는 모델 저장소의 모델 및 토크나이저 파일만큼 중요한 파일입니다. 이는 모델의 핵심 정의로, 동료 커뮤니티 구성원의 재사용성과 결과 재현성을 보장하고 다른 구성원이 아티팩트를 구축할 수 있는 플랫폼을 제공합니다.

 

Documenting the training and evaluation process helps others understand what to expect of a model — and providing sufficient information regarding the data that was used and the preprocessing and postprocessing that were done ensures that the limitations, biases, and contexts in which the model is and is not useful can be identified and understood.

 

교육 및 평가 프로세스를 문서화하면 다른 사람들이 모델에 대해 기대하는 바를 이해하는 데 도움이 됩니다. 사용된 데이터와 수행된 전처리 및 후처리에 대한 충분한 정보를 제공하면 모델이 존재하는 한계, 편향 및 맥락을 보장할 수 있습니다. 유용하지 않은 것을 식별하고 이해할 수 있습니다.

 

Therefore, creating a model card that clearly defines your model is a very important step. Here, we provide some tips that will help you with this. Creating the model card is done through the README.md file you saw earlier, which is a Markdown file.

 

따라서 모델을 명확하게 정의하는 모델 카드를 만드는 것은 매우 중요한 단계입니다. 여기서는 이에 도움이 될 몇 가지 팁을 제공합니다. 모델 카드 생성은 앞서 본 Markdown 파일인 README.md 파일을 통해 이루어집니다.

 

The “model card” concept originates from a research direction from Google, first shared in the paper “Model Cards for Model Reporting” by Margaret Mitchell et al. A lot of information contained here is based on that paper, and we recommend you take a look at it to understand why model cards are so important in a world that values reproducibility, reusability, and fairness.

 

"모델 카드" 개념은 Margaret Mitchell 외 연구진이 "모델 보고를 위한 모델 카드" 논문에서 처음 공유한 Google의 연구 방향에서 비롯되었습니다. 여기에 포함된 많은 정보는 해당 논문을 기반으로 하며, 재현성, 재사용성 및 공정성을 중시하는 세계에서 모델 카드가 왜 그토록 중요한지 이해하기 위해 이 문서를 살펴보는 것이 좋습니다.

 

The model card usually starts with a very brief, high-level overview of what the model is for, followed by additional details in the following sections:

 

모델 카드는 일반적으로 모델의 용도에 대한 매우 간단하고 높은 수준의 개요로 시작하고 다음 섹션의 추가 세부정보가 이어집니다.

 

  • Model description. 모델 설명
  • Intended uses & limitations 용도 및 제한 사항
  • How to use 사용하는 방법
  • Limitations and bias 한계와 편견
  • Training data 훈련 데이터
  • Training procedure 훈련 절차
  • Evaluation results 평가 결과

Let’s take a look at what each of these sections should contain.

 

각 섹션에 어떤 내용이 포함되어야 하는지 살펴보겠습니다.

 

Model description

 

The model description provides basic details about the model. This includes the architecture, version, if it was introduced in a paper, if an original implementation is available, the author, and general information about the model. Any copyright should be attributed here. General information about training procedures, parameters, and important disclaimers can also be mentioned in this section.

 

모델 설명은 모델에 대한 기본 세부정보를 제공합니다. 여기에는 아키텍처, 버전, 논문에 소개된 경우, 원래 구현이 가능한 경우, 작성자 및 모델에 대한 일반 정보가 포함됩니다. 모든 저작권은 여기에 귀속되어야 합니다. 훈련 절차, 매개변수 및 중요한 면책 조항에 대한 일반 정보도 이 섹션에서 언급될 수 있습니다.

 

Intended uses & limitations

Here you describe the use cases the model is intended for, including the languages, fields, and domains where it can be applied. This section of the model card can also document areas that are known to be out of scope for the model, or where it is likely to perform suboptimally.

 

여기서는 모델이 적용될 수 있는 언어, 필드 및 도메인을 포함하여 모델의 사용 사례를 설명합니다. 모델 카드의 이 섹션은 모델의 범위를 벗어나는 것으로 알려진 영역이나 최적이 아닌 성능을 발휘할 가능성이 있는 영역을 문서화할 수도 있습니다.

 

How to use

 

This section should include some examples of how to use the model. This can showcase usage of the pipeline() function, usage of the model and tokenizer classes, and any other code you think might be helpful.

 

이 섹션에는 모델 사용 방법에 대한 몇 가지 예가 포함되어야 합니다. 이는 파이프라인() 함수의 사용법, 모델 및 토크나이저 클래스의 사용법, 도움이 될 수 있다고 생각되는 기타 코드를 보여줄 수 있습니다.

 

Training data

This part should indicate which dataset(s) the model was trained on. A brief description of the dataset(s) is also welcome.

 

이 부분은 모델이 훈련된 데이터세트를 나타내야 합니다. 데이터 세트에 대한 간략한 설명도 환영합니다.

 

Training procedure

In this section you should describe all the relevant aspects of training that are useful from a reproducibility perspective. This includes any preprocessing and postprocessing that were done on the data, as well as details such as the number of epochs the model was trained for, the batch size, the learning rate, and so on.

 

이 섹션에서는 재현성 관점에서 유용한 훈련의 모든 관련 측면을 설명해야 합니다. 여기에는 데이터에 대해 수행된 전처리 및 후처리뿐만 아니라 모델이 훈련된 시대 수, 배치 크기, 학습 속도 등과 같은 세부 정보도 포함됩니다.

 

Variable and metrics

Here you should describe the metrics you use for evaluation, and the different factors you are mesuring. Mentioning which metric(s) were used, on which dataset and which dataset split, makes it easy to compare you model’s performance compared to that of other models. These should be informed by the previous sections, such as the intended users and use cases.

 

여기에서는 평가에 사용하는 측정항목과 측정하는 다양한 요소를 설명해야 합니다. 어떤 측정항목이 사용되었는지, 어떤 데이터세트에 어떤 데이터세트가 분할되었는지 언급하면 모델의 성능을 다른 모델의 성능과 쉽게 비교할 수 있습니다. 이는 의도된 사용자 및 사용 사례와 같은 이전 섹션을 통해 알려야 합니다.

 

Evaluation results

Finally, provide an indication of how well the model performs on the evaluation dataset. If the model uses a decision threshold, either provide the decision threshold used in the evaluation, or provide details on evaluation at different thresholds for the intended uses.

 

마지막으로 모델이 평가 데이터 세트에서 얼마나 잘 수행되는지 표시합니다. 모델이 결정 임계값을 사용하는 경우 평가에 사용되는 결정 임계값을 제공하거나 의도된 용도에 대해 다양한 임계값에서의 평가에 대한 세부 정보를 제공합니다.

 

Example

Check out the following for a few examples of well-crafted model cards:

 

잘 제작된 모델 카드의 몇 가지 예를 보려면 다음을 확인하세요.

 

More examples from different organizations and companies are available here.

 

여기에서 다양한 조직 및 회사의 더 많은 사례를 확인할 수 있습니다.

 

Note

Model cards are not a requirement when publishing models, and you don’t need to include all of the sections described above when you make one. However, explicit documentation of the model can only benefit future users, so we recommend that you fill in as many of the sections as possible to the best of your knowledge and ability.

 

모델을 게시할 때 모델 카드는 필수 사항이 아니며, 모델을 만들 때 위에 설명된 모든 섹션을 포함할 필요는 없습니다. 그러나 모델에 대한 명시적인 문서화는 미래의 사용자에게만 도움이 될 수 있으므로 귀하의 지식과 능력을 최대한 활용하여 가능한 한 많은 섹션을 작성하는 것이 좋습니다.

 

Model card metadata

If you have done a little exploring of the Hugging Face Hub, you should have seen that some models belong to certain categories: you can filter them by tasks, languages, libraries, and more. The categories a model belongs to are identified according to the metadata you add in the model card header.

 

Hugging Face Hub를 조금 탐색했다면 일부 모델이 특정 범주에 속한다는 것을 알았을 것입니다. 작업, 언어, 라이브러리 등을 기준으로 필터링할 수 있습니다. 모델이 속한 카테고리는 모델 카드 헤더에 추가한 메타데이터에 따라 식별됩니다.

 

For example, if you take a look at the camembert-base model card, you should see the following lines in the model card header:

 

예를 들어 camembert-base model card, 를 살펴보면 모델 카드 헤더에 다음 줄이 표시됩니다.

 

---
language: fr
license: mit
datasets:
- oscar
---

 

 

This metadata is parsed by the Hugging Face Hub, which then identifies this model as being a French model, with an MIT license, trained on the Oscar dataset.

 

이 메타데이터는 Hugging Face Hub에 의해 구문 분석되며, 그런 다음 이 모델을 Oscar 데이터 세트에서 훈련된 MIT 라이선스를 갖춘 프랑스 모델로 식별합니다.

 

The full model card specification allows specifying languages, licenses, tags, datasets, metrics, as well as the evaluation results the model obtained when training.

 

The full model card specification allows specifying languages, licenses, tags, datasets, metrics, as well as the evaluation results the model obtained when training.

 

 

반응형