All Projects → jind11 → TitleStylist

jind11 / TitleStylist

Licence: MIT license
Source code for our "TitleStylist" paper at ACL 2020

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to TitleStylist

Walk-Transformer
From Random Walks to Transformer for Learning Node Embeddings (ECML-PKDD 2020) (In Pytorch and Tensorflow)
Stars: ✭ 26 (-63.89%)
Mutual labels:  transformer, pytorch-implementation
verseagility
Ramp up your custom natural language processing (NLP) task, allowing you to bring your own data, use your preferred frameworks and bring models into production.
Stars: ✭ 23 (-68.06%)
Mutual labels:  transformer, summarization
ClusterTransformer
Topic clustering library built on Transformer embeddings and cosine similarity metrics.Compatible with all BERT base transformers from huggingface.
Stars: ✭ 36 (-50%)
Mutual labels:  transformer, pytorch-implementation
VT-UNet
[MICCAI2022] This is an official PyTorch implementation for A Robust Volumetric Transformer for Accurate 3D Tumor Segmentation
Stars: ✭ 151 (+109.72%)
Mutual labels:  transformer, pytorch-implementation
Onnxt5
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Stars: ✭ 143 (+98.61%)
Mutual labels:  transformer, summarization
Abstractive Summarization With Transfer Learning
Abstractive summarisation using Bert as encoder and Transformer Decoder
Stars: ✭ 358 (+397.22%)
Mutual labels:  transformer, summarization
AdaSpeech
AdaSpeech: Adaptive Text to Speech for Custom Voice
Stars: ✭ 108 (+50%)
Mutual labels:  transformer, pytorch-implementation
Scientificsummarizationdatasets
Datasets I have created for scientific summarization, and a trained BertSum model
Stars: ✭ 100 (+38.89%)
Mutual labels:  transformer, summarization
Pytorch Seq2seq
Tutorials on implementing a few sequence-to-sequence (seq2seq) models with PyTorch and TorchText.
Stars: ✭ 3,418 (+4647.22%)
Mutual labels:  transformer, pytorch-implementation
Representation-Learning-for-Information-Extraction
Pytorch implementation of Paper by Google Research - Representation Learning for Information Extraction from Form-like Documents.
Stars: ✭ 82 (+13.89%)
Mutual labels:  transformer, pytorch-implementation
gans-2.0
Generative Adversarial Networks in TensorFlow 2.0
Stars: ✭ 76 (+5.56%)
Mutual labels:  style-transfer
catr
Image Captioning Using Transformer
Stars: ✭ 206 (+186.11%)
Mutual labels:  transformer
Deep-Learning-Pytorch
A repo containing code covering various aspects of deep learning on Pytorch. Great for beginners and intermediate in the field
Stars: ✭ 59 (-18.06%)
Mutual labels:  pytorch-implementation
Transformer-MM-Explainability
[ICCV 2021- Oral] Official PyTorch implementation for Generic Attention-model Explainability for Interpreting Bi-Modal and Encoder-Decoder Transformers, a novel method to visualize any Transformer-based network. Including examples for DETR, VQA.
Stars: ✭ 484 (+572.22%)
Mutual labels:  transformer
DeepChannel
The pytorch implementation of paper "DeepChannel: Salience Estimation by Contrastive Learning for Extractive Document Summarization"
Stars: ✭ 24 (-66.67%)
Mutual labels:  summarization
alpr utils
ALPR model in unconstrained scenarios for Chinese license plates
Stars: ✭ 158 (+119.44%)
Mutual labels:  transformer
Video-Action-Transformer-Network-Pytorch-
Implementation of the paper Video Action Transformer Network
Stars: ✭ 126 (+75%)
Mutual labels:  transformer
text simplification
Text Simplification Model based on Encoder-Decoder (includes Transformer and Seq2Seq) model.
Stars: ✭ 66 (-8.33%)
Mutual labels:  transformer
ImgFastNeuralStyleTransfer TensorFlow
快速风格迁移学习实践
Stars: ✭ 22 (-69.44%)
Mutual labels:  style-transfer
color-aware-style-transfer
Reference code for the paper CAMS: Color-Aware Multi-Style Transfer.
Stars: ✭ 36 (-50%)
Mutual labels:  style-transfer

TitleStylist

Source code for our "TitleStylist" paper at ACL 2020: Jin, Di, Zhijing Jin, Joey Tianyi Zhou, Lisa Orii, and Peter Szolovits. "Hooks in the Headline: Learning to Generate Headlines with Controlled Styles." ACL (2020).. If you use the code, please cite the paper:

@inproceedings{jin2020hooks,
  author    = {Di Jin and Zhijing Jin and Joey Tianyi Zhou and Lisa Orii and Peter Szolovits},
  title     = {Hooks in the Headline: Learning to Generate Headlines with Controlled
               Styles},
  booktitle = {Proceedings of the 58th Annual Meeting of the Association for Computational
               Linguistics, {ACL} 2020, Online, July 5-10, 2020}, pages = {5082--5093},
  publisher = {Association for Computational Linguistics}, year = {2020},
  url       = {https://www.aclweb.org/anthology/2020.acl-main.456/}
}

Here is a talk that introduces our work.

Requirements

Python packages

  • Pytorch
  • fairseq
  • blingfire

In order to install them, you can run this command:

pip install -r requirements.txt

Bash commands

In order to evaluate the generated headlines by ROUGE scores, you need to install the "files2rouge" package. To do so, run the following commands (provided by this repository):

pip install -U git+https://github.com/pltrdy/pyrouge
git clone https://github.com/pltrdy/files2rouge.git     
cd files2rouge
python setup_rouge.py
python setup.py install

Usage

  1. All data including the combination of CNN and NYT article and headline pairs, and the three style-specific corpora (humor, romance, and clickbait) mentioned in the paper have been placed in the folder "data".

  2. Please download the pretrained model parameters of MASS from this link, unzip it, and put the unzipped files into the folder "pretrained_model/MASS".

  3. To train a headline generation model that can simultaneously generated a facutal and a stylistic headline, you can run the following command:

./train_mix_CNN_NYT_X.sh --style YOUR_TARGET_STYLE

Here the arugment YOUR_TARGET_STYLE specifies any style you would like to have, in this paper, we provide three options: humor, romance, clickbait.

After running this command, the trained model parameters will be saved into the folder "tmp/exp".

  1. If you want to evaluate the trained model and generate headlines (both factual and stylistic) using this model, please run the following command:
./evaluate_mix_CNN_NYT_X.sh --style YOUR_TARGET_STYLE --model_dir MODEL_STORED_DIRCTORY

In this command, the argument MODEL_STORED_DIRCTORY specifies the directory which stores the trained model.

  1. If you want to train and evaluate the headline generation model for more than one style, run the following command:
./train_mix_CNN_NYT_multiX.sh
./evaluate_mix_CNN_NYT_multiX.sh --model_dir MODEL_STORED_DIRCTORY

Extension

For the humorous style, although we used humorous novels, you can also try the following datasets:

We suggest that the large dataset Short Jokes is likely to generate good headlines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].