generated_from_trainer text-classification

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

Facemark Detection

This model classifies given text into facemark(1) or not(0).

This model is a fine-tuned version of cl-tohoku/bert-base-japanese-whole-word-masking on an original facemark dataset. It achieves the following results on the evaluation set:

Model description

This model classifies given text into facemark(1) or not(0).

Intended uses & limitations

Extract a facemark-prone potion of text and apply the text to the model. Extraction of a facemark can be done by regex but usually includes many non-facemarks.

For example, I used the following regex pattern to extract a facemark-prone text by perl.

$input_text = "facemark prne text"

my $text          = '[0-9A-Za-zぁ-ヶ一-龠]';
my $non_text      = '[^0-9A-Za-zぁ-ヶ一-龠]';
my $allow_text    = '[ovっつ゜ニノ三二]';
my $hw_kana       = '[ヲ-゚]';
my $open_branket  = '[\(∩꒰(]';
my $close_branket = '[\)∩꒱)]';
my $around_face   = '(?:' . $non_text . '|' . $allow_text . ')*';
my $face          = '(?!(?:' . $text . '|' . $hw_kana . '){3,8}).{3,8}';
my $face_char     = $around_face . $open_branket . $face . $close_branket . $around_face;

my $facemark;
if ($input_text=~/($face_char)/) {
  $facemark = $1; 
}

Example of facemarks are:

  (^U^)←
  。\n\n⊂( *・ω・ )⊃
  っ(。>﹏<)
  タカ( ˘ω' ) ヤスゥ…
  。(’↑▽↑)
  ……💰( ˘ω˘ )💰
  ーーー(*´꒳`*)!(
  …(o:∇:o)
 !!…(;´Д`)?
  (*´﹃ `*)✿

Examples of non-facemarks are:

  (3,000円)
  : (1/3)
  (@nVApO)
  (10/7~)
  ?<<「ニャア(しゃーねぇな)」プイッ
  (残り 51字)
  (-0.1602)
  (25-0)
  (コーヒー飲んだ)
  (※軽トラ)

This model intended to use for a facemark-prone text like above.

Training and evaluation data

Facemark data is collected manually and automatically from Twitter timeline.

Training procedure

python ./examples/pytorch/text-classification/run_glue.py \
   --model_name_or_path=cl-tohoku/bert-base-japanese-whole-word-masking \
   --do_train --do_eval \
   --max_seq_length=128 --per_device_train_batch_size=32 \
   --use_fast_tokenizer=False --learning_rate=2e-5 --num_train_epochs=50  \
   --output_dir=facemark_classify \
   --save_steps=1000 --save_total_limit=3 \
   --train_file=train.csv \
   --validation_file=test.csv 

Training hyperparameters

The following hyperparameters were used during training:

Training results

It achieves the following results on the evaluation set:

Framework versions