Giter VIP home page Giter VIP logo

adl_hw3's Introduction

ADL HW3

利用mT5決定一段文章的標題

Training

使用huggingface的script

python run_summarization.py \
    --model_name_or_path google/mt5-small \
    --do_train \
    --do_eval \
    --evaluation_strategy epoch \
    --gradient_accumulation_steps 8 \
    --train_file ./data/train.json \
    --validation_file ./data/public.json \
    --text_column maintext \
    --learning_rate 1e-3 \
    --num_train_epochs 5 \
    --summary_column title \
    --dataset_config "3.0.0" \
    --source_prefix "summarize: " \
    --output_dir ./model \
    --per_device_train_batch_size=2 \
    --save_strategy epoch \
    --per_device_eval_batch_size=2 \
    --overwrite_output_dir \
    --optim adafactor \
    --save_total_limit 1 \
    --predict_with_generate

Testing

python predict.py\
  --test_file </path/to/test_file>\
  --pred_file </path/to/pred_file>\
  [--num_beams ]\
  [--top_k ]\
  [--top_p ]\
  [--temperature]\
  [--do_sample ]

result

  • rouge-1: 25.196
  • rouge-2: 10.045
  • rouge-3: 22.792

Reproduce my result

bash ./run.sh </path/to/input.jsonl> </path/to/output.jsonl>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.