Giter Site home page Giter Site logo

text_summarization's Introduction

当代人工智能实验四:文本摘要


介绍


本实验实践了一个基于 **Encoder-Decoder 架构的序列到序列(seq2seq)模型**,进行了一个文本摘要的任务。

环境配置


  • 本项目所使用的环境为python3.9
  • 为了更快地安装本实验所需要一些库,可以执行下列代码换源后安装
  • 安装requirements.txt
pip install --upgrade pip 
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt

运行方式


由于Seq2seq模型训练时间似乎较长,本实验保存了训练好的模型,可以直接进行测试,也可以进行训练。

训练模型:

利用argparse包提供了一些可以调整的参数:

  • --model, default='Seq2SeqBART'
  • --lr, default=0.05
  • --dropout, default=0.0
  • --epoch, default=1
  • --batch_size, default=16

以下是两个代码训练运行的示例(需要将main中注释掉的train取消注释):

python main.py --model Seq2SeqLSTM --lr 0.1
python main.py --model Seq2SeqBART --lr 0.05

直接运行main.py会加载保存下来的模型开始测试:

python main.py

text_summarization's People

Contributors

maeassar avatar

Watchers

Kostas Georgiou avatar  avatar

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.