[LEADERG AI ZOO] Jupyter-BERT

Language:

繁體中文

 

 

 

[Introduction]

 

 

The application areas of BERT include Question Answer system, reading comprehension, semantic disassembly, and semantic analysis. 

 

 

[Instructions]

 

 

SQuAD2.0

 

 

1. 1_SQuAD2.0_Fine_Tuning_GPU.ipynb

 

Use BERT to train and fine-tune the SQuAD2 Question Answer database, and the fine-tuned model path: model/SQuAD2.0. 

 

 

2. 2_SQuAD2.0_Inference_GPU.ipynb

 

Infer data/SQuAD2.0/dev-v2.0.json (there are many questions and answers in it).

The answer result is placed in output/SQuAD2.0/nbest_predictions.json, where if the answer is no answer, his threshold value --null_score_diff_threshold will be recorded in null_odds.json. 

 

 

3. 3_SQuAD2.0_Evaluate_GPU.ipynb

 

Evaluate the relevant data of the model and calculate the appropriate threshold best_f1_thresh for inference.

When making inferences, substitute this value into --null_score_diff_threshold to distinguish whether the question has an answer. 

 

 

ELMo

 

 

4. 4_ELMo_Extract_Fixed_Feature_GPU.ipynb

 

data/glue-data/ELMo/input.txt for semantic disassembly.

The sentence part of speech is disassembled, the feature vector is extracted, and output to data/output/ELMo/output.json. 

 

 

MRPC

 

 

5. 5_MRPC_Fine_Tuning_GPU.ipynb

 

Training and fine-tuning MRPC, output model path: model/MRPC. 

 

 

6. 6_MRPC_Inference_GPU.ipynb

 

Perform semantic analysis on data/glue-data/MRPC/test.tsv, analyze whether the two sentences have the same meaning, and output the result to data/output/test_results.tsv.

The output result is the probability of category 0 or the probability of category 1. The higher the value, the higher the degree of the category.

(Category 0: Two sentences have different meanings; Category 1: Two sentences are synonymous) 

 

inference.png  


Recommended Article

1.
LEADERG AOI VISION - AI Image Analysis Software (No Code, Windows User Interface, Deep Learning, Machine Learning)

2.
LEADERG AI ZOO - AI Sample Code Software (Save 90% of Development Time, Low Code, Jupyter Lab User Interface, Deep Learning, Machine Learning, Big Data)

3.
LEADERG AI Computer (Deep Learning, PC, workstation, server, NVIDIA GPU, TESLA A100, RTX-3090-24G, Intel VPU, GPU Server)

4.
LEADERG AI Education

Thanks for our customers

Taiwan University, Tsing Hua University, Yang Ming Chiao Tung University, Cheng Kung University, Taipei Medical University, Taipei University of Nursing and Health Sciences, National Chung Hsing University, Chi Nan University, Ilan University, United University, Defence University, Military Academy, Naval Academy, Feng Chia University, Chang Gung University, I-Shou University, Shih Chien University, Taiwan University of Science and Technology, Taichung University of Science and Technology, Yunlin University of Science and Technology, Chin-Yi University of Science, Formosa University, Pintung University of Science and Technology, Kaohsiung University of Science and Technology, Chaoyang University of Technology, Ming Chi University of Technology, Southern Taiwan University of Science and Technology, China University of Technology, Gushan Senior High School, Taipei Veterans General Hospital, Chang Gung Medical Foundation, Tzu Chi Medical Foundation, E-Da Hospital, Industry Technology Research Institute, Institute for Information Industry, Chung-Shan Institute of Science and Technology, Armaments Bureau, Ministry of Justice Investigation Bureau, Institute of Nuclear Energy Research, Endemic Species Research Institute, Institute of Labor, Occupational Safety And Health, Metal Industries Research & Development Centre, Taiwan Instrument Research Institute, Automotive Research & Testing Center, Taiwan Water Corporation, Taiwan Semiconductor Manufacturing Co., Ltd., United Microelectronics Corp., Nanya Technology, Winbond Electronics Corp., Xintec Inc., Arima Lasers Corporation, AU Optronics Corporation, Innolux Corporation, HannStar Display Corporation, Formosa Plastics Group., Formosa Technologies Corporation, Nan Ya Plastics Corp., Formosa Chemicals & Fibre Corporation, Chinese Petroleum Corporation, Logitech, ELAN Microelectronics Corp., Lextar Electronics Corporation, Darfon Electronics Corp., WPG Holdings, Mirle Automation Corporation, Symtek Automation Asia Co., Ltd, ChipMOS Technologies Inc., Dynapack International Technology Corporation, Primax Electronics Ltd., Feng Hsin Steel, China Ecotek, Grade Upon Technology Corp., AAEON Technology Inc., Stark Technology, Inc., Horng Terng Automation Co., Ltd., Zhen Ding Technology Holding Ltd, Boardtek Electronics Corporation, MiTAC International Corporation, Allion Labs, Inc., Sound Land Corp., Hong Hu Tech, etc.