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

This SDK is built in AppForAI - AI Dev Tools.

Purchase license separately: USD 600, permanent authorization, single APP authorization, single machine authorization, one-year activation, one-year download, one-year update, one-year email technical support.