Code for ACL 2021 main conference paper "Conversations are not Flat: Modeling the Intrinsic Information Flow between Dialogue Utterances".

Overview

Conversations are not Flat: Modeling the Intrinsic Information Flow between Dialogue Utterances

This repository contains the code and pre-trained models for our ACL 2021 paper Conversations are not Flat: Modeling the Intrinsic Information Flow between Dialogue Utterances.

Our paper will be public soon!

**************************** Updates ****************************

  • 5/10: We released the code and pre-trained model of Flow Score. Try to use it!

Overview

We propose the DialoFlow, a new paradigm to construct the dynamic information flow in the dialogue history by addressing the semantic influence brought about by each utterance. Besides, we design an automatic reference-free evaluation metric Flow Score based on the pre-trained DialoFlow for interactive dialogue quality evaluation.

Overview of DialoFlow

DialoFlow

We will release the code and pre-trained models soon!

Flow Score

Flow Score is an automatic reference-free evaluation metric for interactive dialogue evaluation based on the pre-trained DialoFlow. Flow Score can be found here.

Citation

Please cite our paper if you use DialoFlow in your work.

@inproceedings{li2021dialoflow,
   title={Conversations are not Flat: Modeling the Intrinsic Information Flow between Dialogue Utterances},
   author={Li, Zekang and Zhang, Jinchao and Fei, Zhengcong and Feng, Yang and Zhou, Jie},
   booktitle={Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics},
   year={2021}
}
Comments
  • How to reproduce

    How to reproduce

    I reproduce the DialoFlow base in DailyDialog, the evaluation results are: NIST: [2.9148, 3.3919, 3.5077, 3.5375] BLEU: [0.4535, 0.2323, 0.1367, 0.086] METEOR: 0.1479778034868275 Entropy: [6.250107671407306, 8.663223223839859, 9.603956363262926, 9.959120587252972] Distinct: [0.08599954617653732, 0.32188216456202917] avg_len: 9.154005934718102

    The results are lower than the results shown in paper.

    Can you show the detail of fine-tune in DailyDialog?

    My setting is: Training: Batch_size 16 (4 GPU , per_gpu_batch_size=4) gradient_accumulation_steps 1 epoch 50

    The best Validation loss is 7.5168, at epoch 34.

    generate: The Config parameters is default,and I set the beam_size=5.

    And I did not use the Apex.

    opened by FlyingCat-fa 8
  • Pre-trained model release date?

    Pre-trained model release date?

    We are really interested in using DialoFlow for our research on chatbots and their influence on psychological well-being. Our experiments should presumably start in the span of 2-3 weeks. Will the pre-trained DialoFlow model be available by then?

    opened by anelkhvan 6
  • Model evaluation

    Model evaluation

    First of all, kudos for this nice work. I really liked your work. I am trying to reproduce the results of your paper. It will be very helpful if you could share the evaluation script for the automated metrics. In the paper, it is written that "We employ the evaluation scripts used by DialoGPT.". Could you please point out the DialoGPT file used for your evaluation.

    opened by SuvodipDey 4
  • Nan in README instruction

    Nan in README instruction

    Hi,

    I followed "How to use?" in the README but got strange results. flow_score is nan.

    The only changes is putting these tensors to self.cuda and my environment has no GPU.

    https://github.com/ictnlp/DialoFlow/blob/f4a69fde3ad9bf82a64640f3f9754040630cfd74/FlowScore/flow_score.py#L99-L101

    Environment: python==3.7 torch==1.7.0 transformers==3.0.2 regex==2017.4.5

    Could you please provide some guides to solve this?

    opened by adamlin120 4
  • No module named '_regex'

    No module named '_regex'

    Hello,

    I followed the README but got some errors. I want to use Flow score for the evaluation metric analysis. when I run the code: from flow_score import * MODEL_PATH = "models/DialoFlow_large.bin" FLOW_SCORE = FlowScore(MODEL_PATH) dialogues = ["hello", "Hi there. tell me about yourself.", "Well I'm a college student who loves learning about the world around me!","verry good !"] flow_score = FLOW_SCORE.score(dialogues)

    An error has occurred:ModuleNotFoundError: No module named '_regex' environment:python==3.7 torch==1.7.0 transformers==3.0.2; pickle==4.0;
    I don't know what happen .How do I need to solve the version or the environment problem? image image

    opened by 18166035475 3
  • Getting 'nan' flow_score

    Getting 'nan' flow_score

    I am trying to run the code:

    from flow_score import *
    MODEL_PATH = "models/DialoFlow_large.bin"
    FLOW_SCORE = FlowScore(MODEL_PATH)
    dialogues = ["hello", "Hi there. tell me about yourself.", "Well I'm a college student who loves learning about the world around me!"]
    flow_score = FLOW_SCORE.score(dialogues)
    

    I am using torch==1.7.1 and transformers==3.0.2.

    The value of flow_score I get is 'nan' and I am getting a lot of warnings when loading the model:

    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'model.DPKSModel' has changed. Saved a reverse patch to DPKSModel.patch. Run `patch -p0 < DPKSModel.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'transformers.modeling_gpt2.GPT2Model' has changed. Saved a reverse patch to GPT2Model.patch. Run `patch -p0 < GPT2Model.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.sparse.Embedding' has changed. Saved a reverse patch to Embedding.patch. Run `patch -p0 < Embedding.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. Saved a reverse patch to Dropout.patch. Run `patch -p0 < Dropout.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.container.ModuleList' has changed. Saved a reverse patch to ModuleList.patch. Run `patch -p0 < ModuleList.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.normalization.LayerNorm' has changed. Saved a reverse patch to LayerNorm.patch. Run `patch -p0 < LayerNorm.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'model.PlanModel' has changed. Saved a reverse patch to PlanModel.patch. Run `patch -p0 < PlanModel.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.loss.MSELoss' has changed. Saved a reverse patch to MSELoss.patch. Run `patch -p0 < MSELoss.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. Saved a reverse patch to Linear.patch. Run `patch -p0 < Linear.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.activation.Sigmoid' has changed. Saved a reverse patch to Sigmoid.patch. Run `patch -p0 < Sigmoid.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    /DialoFlow/FlowScore/dialoflow_venv/lib/python3.9/site-packages/torch/serialization.py:658: SourceChangeWarning: source code of class 'torch.nn.modules.loss.CrossEntropyLoss' has changed. Saved a reverse patch to CrossEntropyLoss.patch. Run `patch -p0 < CrossEntropyLoss.patch` to revert your changes.
      warnings.warn(msg, SourceChangeWarning)
    

    How could I fix this and get numerical scores? Could you share the requirements.txt? maybe it is other packages that are causing the issue.

    opened by Youmna-H 2
  • config.json not found

    config.json not found

    I got the following error when running the fine-tune.sh:

    Traceback (most recent call last): File "D:\python3.7\lib\site-packages\transformers\configuration_utils.py", line 238, in get_config_dict local_files_only=local_files_only, File "D:\python3.7\lib\site-packages\transformers\file_utils.py", line 578, in cached_path raise EnvironmentError("file {} not found".format(url_or_filename)) OSError: file ../models/DialoFlow_base/config.json not found

    Could you tell me where is your model's config file? I couldn't find it. Thanks.

    opened by trestad 2
  • logger/log.out Issue

    logger/log.out Issue

    Hello, I fellow README about instruction "bash fine-tune.sh" while got error of "fine-tune.sh: line 1: logger/log.out: No such file or directory".

    How can I solve it? Thanks for Help!

    opened by CheckEO 2
  • Turn-level DSTC9 annotation data

    Turn-level DSTC9 annotation data

    I noticed there is just dialog-level DSTC9 data used in your work. May I ask if turn-level DSTC9 annotation data is made public? How can I get this data? Thank you very much!

    opened by SYSU-lulc 0
  • Why PlanModel didn't use mask

    Why PlanModel didn't use mask

         for i, block in enumerate(self.h):
            outputs = block(hidden_states)
            hidden_states, present = outputs[:2]
    

    in this code , planmodel didn't use mask . it make seq can attention future context

    opened by JYlsc 0
  • about data tokenizer

    about data tokenizer

    hello, i see tokenizer seq in paper is : [u1] [C] [u2] [C] [res] [C]

    but tokenizer in code dataset is : [speaker1] [u1] [eos] [speaker2] [u2] [eos] [bos] [res] [eos]

    Is there any difference between the two? which works best

    opened by JYlsc 0
  • Cannot access to googledrive.

    Cannot access to googledrive.

    Hi, Dr. Li, Thank you for your code. But I cannot access to googledrive for some reasons. Could you provide another position to download your pre-trained models, like DialoFlow-base? Thanks for your reply in advance.

    opened by katherinelyx 0
  • Clarification on post-processing generated result

    Clarification on post-processing generated result

    Hi. Kudos for this nice work. I am trying to reproduce the results on DailyDialog dataset. It will be very helpful if you can clarify the following details. In Issue #13, you mentioned using "nltk.word_tokenize() to tokenize the sentence and then concatenate the tokens" to make the format of the generated dialogue same as the reference response. I have two questions here,

    1. Did you use any post-processing on the reference files?
    2. Did you try only nltk.word_tokenize() or some other tokenizer as well?

    It will be very useful if you can briefly mention your post-processing steps.

    opened by SuvodipDey 2
  • about the Automatic evaluation

    about the Automatic evaluation

    First of all, thank you very much for your help. I have encountered a problem and hope you can answer it. I used myself to implement the automatic evaluation indicators, but the results are quite different from those in the paper. Can you please disclose the implementation code of your evaluation indicators?

    opened by bingfeiz 4
Owner
ICTNLP
Natural Language Processing Group, Institute of Computing Technology, Chinese Academy of Sciences
ICTNLP
Code for EMNLP 2021 main conference paper "Text AutoAugment: Learning Compositional Augmentation Policy for Text Classification"

Code for EMNLP 2021 main conference paper "Text AutoAugment: Learning Compositional Augmentation Policy for Text Classification"

LancoPKU 105 Jan 3, 2023
IndoBERTweet is the first large-scale pretrained model for Indonesian Twitter. Published at EMNLP 2021 (main conference)

IndoBERTweet ?? ???? 1. Paper Fajri Koto, Jey Han Lau, and Timothy Baldwin. IndoBERTweet: A Pretrained Language Model for Indonesian Twitter with Effe

IndoLEM 40 Nov 30, 2022
Python Implementation of ``Modeling the Influence of Verb Aspect on the Activation of Typical Event Locations with BERT'' (Findings of ACL: ACL 2021)

BERT-for-Surprisal Python Implementation of ``Modeling the Influence of Verb Aspect on the Activation of Typical Event Locations with BERT'' (Findings

null 7 Dec 5, 2022
Hostapd-mac-tod-acl - Setup a hostapd AP with MAC ToD ACL

A brief explanation This script provides a quick way to setup a Time-of-day (Tod

null 2 Feb 3, 2022
Code for our paper "Mask-Align: Self-Supervised Neural Word Alignment" in ACL 2021

Mask-Align: Self-Supervised Neural Word Alignment This is the implementation of our work Mask-Align: Self-Supervised Neural Word Alignment. @inproceed

THUNLP-MT 46 Dec 15, 2022
Code for our ACL 2021 paper - ConSERT: A Contrastive Framework for Self-Supervised Sentence Representation Transfer

ConSERT Code for our ACL 2021 paper - ConSERT: A Contrastive Framework for Self-Supervised Sentence Representation Transfer Requirements torch==1.6.0

Yan Yuanmeng 478 Dec 25, 2022
Code for our ACL 2021 (Findings) Paper - Fingerprinting Fine-tuned Language Models in the wild .

?? Fingerprinting Fine-tuned Language Models in the wild This is the code and dataset for our ACL 2021 (Findings) Paper - Fingerprinting Fine-tuned La

LCS2-IIITDelhi 5 Sep 13, 2022
Code for our paper "Transfer Learning for Sequence Generation: from Single-source to Multi-source" in ACL 2021.

TRICE: a task-agnostic transferring framework for multi-source sequence generation This is the source code of our work Transfer Learning for Sequence

THUNLP-MT 9 Jun 27, 2022
null 189 Jan 2, 2023
A PyTorch implementation of paper "Learning Shared Semantic Space for Speech-to-Text Translation", ACL (Findings) 2021

Chimera: Learning Shared Semantic Space for Speech-to-Text Translation This is a Pytorch implementation for the "Chimera" paper Learning Shared Semant

Chi Han 43 Dec 28, 2022
A PyTorch implementation of paper "Learning Shared Semantic Space for Speech-to-Text Translation", ACL (Findings) 2021

Chimera: Learning Shared Semantic Space for Speech-to-Text Translation This is a Pytorch implementation for the "Chimera" paper Learning Shared Semant

Chi Han 43 Dec 28, 2022
Code for papers "Generation-Augmented Retrieval for Open-Domain Question Answering" and "Reader-Guided Passage Reranking for Open-Domain Question Answering", ACL 2021

This repo provides the code of the following papers: (GAR) "Generation-Augmented Retrieval for Open-domain Question Answering", ACL 2021 (RIDER) "Read

morning 49 Dec 26, 2022
(ACL 2022) The source code for the paper "Towards Abstractive Grounded Summarization of Podcast Transcripts"

Towards Abstractive Grounded Summarization of Podcast Transcripts We provide the source code for the paper "Towards Abstractive Grounded Summarization

null 10 Jul 1, 2022
Code for Findings of ACL 2022 Paper "Sentiment Word Aware Multimodal Refinement for Multimodal Sentiment Analysis with ASR Errors"

SWRM Code for Findings of ACL 2022 Paper "Sentiment Word Aware Multimodal Refinement for Multimodal Sentiment Analysis with ASR Errors" Clone Clone th

null 14 Jan 3, 2023
Findings of ACL 2021

Assessing Dialogue Systems with Distribution Distances [arXiv][code] We propose to measure the performance of a dialogue system by computing the distr

Yahui Liu 16 Feb 24, 2022
LV-BERT: Exploiting Layer Variety for BERT (Findings of ACL 2021)

LV-BERT Introduction In this repo, we introduce LV-BERT by exploiting layer variety for BERT. For detailed description and experimental results, pleas

Weihao Yu 14 Aug 24, 2022
ACL'2021: Learning Dense Representations of Phrases at Scale

DensePhrases DensePhrases is an extractive phrase search tool based on your natural language inputs. From 5 million Wikipedia articles, it can search

Princeton Natural Language Processing 540 Dec 30, 2022
Implementaion of our ACL 2022 paper Bridging the Data Gap between Training and Inference for Unsupervised Neural Machine Translation

Bridging the Data Gap between Training and Inference for Unsupervised Neural Machine Translation This is the implementaion of our paper: Bridging the

hezw.tkcw 20 Dec 12, 2022
Code for "Parallel Instance Query Network for Named Entity Recognition", accepted at ACL 2022.

README Code for Two-stage Identifier: "Parallel Instance Query Network for Named Entity Recognition", accepted at ACL 2022. For details of the model a

Yongliang Shen 45 Nov 29, 2022