GithubHelp home page GithubHelp logo

qbuer / tagger_rewriter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhusleep/tagger_rewriter

0.0 1.0 0.0 33.47 MB

对话改写介绍文章

Home Page: https://zhuanlan.zhihu.com/p/137127209

Python 100.00%

tagger_rewriter's Introduction

抽取式多轮对话改写

模型结构

模型结构

Pytorch 版本运行方式

cd src
python3 pt/rewrite_tagger.py

Pytorch 环境

预训练语言模型rb3,可以在 https://github.com/ymcui/Chinese-BERT-wwm 下载。或者修改成你自己的预训练模型
rouge==1.0.0
tokenizers==0.9.3
torch==1.7.1+cu101
torchaudio==0.7.2
torchvision==0.8.2+cu101
tqdm==4.56.0
transformers==3.5.1
pandas==1.1.5
注意 pytorch 根据自己的cuda版本选择安装。

Tensorflow 版本运行方式

cd src
python3 tf/rewrite_tagger.py

Tensorflow 环境

例子中采用 albert_small_zh_google

预训练语言模型albert_small_zh_google,可以在 https://github.com/brightmart/albert_zh 下载。或者修改成你自己的预训练模型
rouge==1.0.0
tokenizers==0.9.3
torch==1.7.1+cu101
torchaudio==0.7.2
torchvision==0.8.2+cu101
tqdm==4.56.0
transformers==3.5.1
pandas==1.1.5

结果

  • 1 epoch
  • {'rouge-1': {'f': 0.89, 'p': 0.94, 'r': 0.87}, 'rouge-2': {'f': 0.7824, 'p': 0.821, 'r': 0.7667}, 'rouge-l': {'f': 0.848, 'p': 0.890, 'r': 0.828}, 'em': 0.5}
------------
你知道板泉井水吗  |  知道  |  她是歌手  |  板泉井水是歌手  |  板泉井水是歌手
乌龙茶  |  乌龙茶好喝吗  |  嗯好喝  |  嗯乌龙茶好喝  |  嗯乌龙茶好喝
武林外传  |  超爱武林外传的  |  它的导演是谁  |  武林外传的导演是谁  |  武林外传的导演是谁
李文雯你爱我吗  |  李文雯是哪位啊  |  她是我女朋友  |  李文雯是我女朋友  |  李文雯是我女朋友
舒马赫  |  舒马赫看球了么  |  看了  |  舒马赫看了  |  舒马赫看球了
徐彬我好想你  |  谁是徐斌  |  他是经济学博士现在为首都经济贸易大学劳动经济学院人才系主任  |  徐彬是经济学博士现在为首都经济贸易大学劳动经济学院人才系主任  |  徐斌是经济学博士现在为首都经济贸易大学劳动经济学院人才系主任

tagger_rewriter's People

Contributors

dependabot[bot] avatar zhiwenmo avatar zhusleep avatar

Watchers

 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.