# Fileset

[MaterialBERT_README__20220808.md](https://mdr.nims.go.jp/filesets/3a22e6b8-22bd-4fc8-a304-29196fbb6f1e/download)

## Creator

KAWANO, Hiroyuki, SATO, Fumitaka, [YOSHITAKE, Michiko](https://orcid.org/0000-0002-0973-5666), MOTEKI, Fuma, TERAOKA, Hiroshi

## Rights

[Creative Commons BY-ND Attribution-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nd/4.0/)

## Other metadata

[MaterialBERT for Natural Language Processing of Materials Science Texts](https://mdr.nims.go.jp/datasets/936f7bdd-e1eb-4100-929b-db71a00f8df9)

## Fulltext

# Material BERT## Material BERTとは国立研究開発法人物質・材料研究機構が主導で開発している材料分野に特化したBERTモデルである。下記の３種のフォルダーに、情報が格納されている1. Jxiv_article　(論文原稿PDFと関連ファイル)2. MaterialBERT_Pre-trained_Model (using original vocabulary list)3. MaterialBERT_Dict_Pre-trained_Model (using newly-made vocabulary list generated from our corpus)### 学習アルゴリズムGoogle リリースの[uncased_L-12_H-768_A-12_2021](https://github.com/google-research/bert)## Pre-trainingモデルについて### データソースJxivの記事に記載同記事に添付のジャーナルリストにある論文のアブストラクトと本文を使用### vocabulary list(辞書)下記の２種類の vocabulary list を用いて、それぞれPre-trainingモデルを作成1. BERTのオリジナル辞書 [vocab.txt](https://github.com/google-research/bert)2. 上記 vocab.txt に、データソースからSentencePieceにより作成した材料分野に特化した語を追加したadd-vocab.txt## 本公開コードを用いて、Material BERTで行えるタスク### CoLA(The Corpus of Linguistic Acceptability)文章が英語文法として正しいかどうかを判定する分類タスク#### 実行コマンド```python run_classifier_BERT.py \ --task_name=CoLA \ --do_predict=true \ --data_dir=CoLA_data \ --vocab_file=uncased_L-12_H-768_A-12_2021/vocab.txt \ --bert_config_file=uncased_L-12_H-768_A-12_2021/bert_config.json \ --init_checkpoint=model_ckpt/ \ --max_seq_length=128 \ --output_dir=CoLA_data/```#### インプットCoLA_data/test_BERT.tsv##### データ構造| index | sentence                            || ----- | ----------------------------------- || 1     | The car was driven.                 || 2     | Everyone hoped that she would sing. || ...   | ...                                 |#### アウトプットCoLA_data/test_results_BERT.tsv##### データ構造| 1列目: 文法が間違っている確率 | 2列目: 文法が正しい確率 || ----------------------------- | ----------------------- || 0.428124                      | 0.57187605              || 0.37896726                    | 0.6210327               || ...                           | ...                     |## ディレクトリ構成### BERTのvocabraly list(vocab.txt)を用いたモデルMaterialBERT_Pre-trained_Model/​ ├ CoLA_data/​ │   └ test_BERT.tsv​ ├ uncased_L-12_H-768_A-12_2021/​ │   ├  vocab.txt​ │   └ bert_config.json​ ├ model_ckpt/​ │   ├ checkpoint​ │   ├  model.ckpt-6413.data-00000-of-00001​ │   ├  model.ckpt-6413.index​ │   └ model.ckpt-6413.meta​ ├ run_classifier_BERT.py​ ├ modeling.py​ ├ optimization.py​ └ tokenization.py### 材料分野に特化した語を追加したvocabraly list(add-vocab.txt)を用いたモデルMaterialBERT_Dict_Pre-trained_Model/​ ├ model_ckpt/​ │   ├ checkpoint​ │   ├  model.ckpt-288000.data-00000-of-00001​ │   ├  model.ckpt-288000.index​ │   └ model.ckpt-288000.meta​ └ add_vocab.txt## 使用ライブラリとバージョン- python >= 3.7.6- CUDA >= 9.2- collections- csv >= 1.0- os- tensorflow >= 1.13.1- copy- json >= 2.0.9- math- re >=2.2.1- numpy >= 1.18.1- six >= 1.14.0## Copyright### ContributorYoshitake, Michiko: 1. National Institute for Materials Science, MaDISSato, Fumitaka: 1. National Institute for Materials Science, MaDIS, 2. Business Science Unit，Ridgelinez Limited Kawano, Hiroyuki: 1. National Institute for Materials Science, MaDIS, 2. Business Science Unit，Ridgelinez LimitedTeraoka, Hiroshi: 1. National Institute for Materials Science, MaDIS, 2. Business Science Unit，Ridgelinez LimitedMoteki, Fuma:  1. National Institute for Materials Science, MaDIS, 2. Business Science Unit，Ridgelinez Limited### License of the programs and parameter filesBSD License (3-clause BSD License)Copyright (c) 2022, National Institute for Materials ScienceRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.