DialoGPT | Large-scale pretraining for dialogue | Chat library

 by   microsoft Python Version: Current License: MIT

kandi X-RAY | DialoGPT Summary

kandi X-RAY | DialoGPT Summary

DialoGPT is a Python library typically used in Messaging, Chat, Deep Learning, Pytorch, Neural Network, Transformer applications. DialoGPT has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub.

This repository contains the source code and trained model for a large-scale pretrained dialogue response generation model. The human evaluation results indicate that the response generated from DialoGPT is comparable to human response quality under a single-turn conversation Turing test. The repository is based on huggingface pytorch-transformer and OpenAI GPT-2, containing data extraction script, model training code and pretrained small (117M) medium (345M) and large (762M) model checkpoint. The model is trained on 147M multi-turn dialogue from Reddit discussion thread. The largest model can be trained in several hours on a 8 V100 machines (however this is not required), with distributed training and FP16 option. The include script can be used to reproduce the results of DSTC-7 grounded dialogue generation challenge and a 6k multi-reference dataset created from Reddit data.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              DialoGPT has a medium active ecosystem.
              It has 2181 star(s) with 333 fork(s). There are 56 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 59 open issues and 23 have been closed. On average issues are closed in 37 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of DialoGPT is current.

            kandi-Quality Quality

              DialoGPT has 0 bugs and 0 code smells.

            kandi-Security Security

              DialoGPT has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              DialoGPT code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              DialoGPT is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              DialoGPT releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              DialoGPT saves you 1281 person hours of effort in developing the same functionality from scratch.
              It has 2892 lines of code, 165 functions and 36 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed DialoGPT and discovered the below as its top functions. This is intended to give you an instant insight into DialoGPT implemented functionality, and help decide if they suit your requirements.
            • Reads a Convo file into a dictionary
            • Return a list of examples that have the same length .
            • Compute the Cider .
            • Perform a single step .
            • Removes offensive words from src .
            • This function writes the xml file .
            • Main function .
            • Extract comments from a file .
            • Wrapper for all reduce_tensors .
            • Create a feature .
            Get all kandi verified functions for this library.

            DialoGPT Key Features

            No Key Features are available at this moment for DialoGPT.

            DialoGPT Examples and Code Snippets

            Plug-and-Play Conversational Models,Reproducibility
            Pythondot img1Lines of Code : 11dot img1License : Permissive (MIT)
            copy iconCopy
            ❱❱❱ unzip data.zip
            
            ❱❱❱ unzip dialoGPT.zip
            ❱❱❱ mv dialiGPT models
            
            ❱❱❱ unzip discriminators.zip
            ❱❱❱ mv discriminators models
            
            ❱❱❱ unzip scorers.zip
            ❱❱❱ mv scorers models
            
            ❱❱❱ unzip evaluate.zip
            ❱❱❱ mv evaluate results
            ❱❱❱ python evaluate.py
            
            ❱❱❱ unzi  
            Installation of dependencies:
            Pythondot img2Lines of Code : 8dot img2License : Permissive (MIT)
            copy iconCopy
            $ sudo apt-get update
            $ sudo apt-get install python3-pip libffi-dev libnacl-dev python3-dev
            
            $ passwd 
            
            $ sudo adduser bot
            $ su - bot
            $ pip3 install -U torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
            $ pi  
            A Russian DialoGPT model,Training the model
            Pythondot img3Lines of Code : 7dot img3License : Permissive (MIT)
            copy iconCopy
            0.0 Вот, держите. EOS А на чай? EOS Никакого чая. я ученый, а не банкир.	1.0 Ага, не банкир. живет во дворце и денег нет, так я и поверил.
            0.0 Я собиралась спросить тебя то же самое.	1.0 Я получил записку от сэра Гарри, в которой он просит меня подой  

            Community Discussions

            QUESTION

            Chatbot using Huggingface Transformers
            Asked 2022-Mar-04 at 19:46

            I would like to use Huggingface Transformers to implement a chatbot. Currently, I have the code shown below. The transformer model already takes into account the history of past user input.

            Is there something else (additional code) I have to take into account for building the chatbot?

            Second, how can I modify my code to run with TensorFlow instead of PyTorch?

            Later on, I also plan to fine-tune the model on other data. I also plan to test different models such as BlenderBot and GPT2. I think to test this different models it should be as easy as replacing the corresponding model in AutoTokenizer.from_pretrained("microsoft/DialoGPT-small") and AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-small")

            ...

            ANSWER

            Answered 2021-Nov-21 at 17:17

            Here is an example of using the DialoGPT model with Tensorflow:

            Source https://stackoverflow.com/questions/70055966

            QUESTION

            How to use a pre-trained language model correctly?
            Asked 2021-Mar-26 at 11:07

            I'm trying to use a Huggingface pretrained model "GPT2dialog" as a encoder for sentences,But the textindexer confused me. In detail ,I can run a unittest for dataset_reader with a pretrained indexer normally,when use the train command to train the model caused a Bug:

            ...

            ANSWER

            Answered 2021-Mar-26 at 11:07

            The token_indexer needs to be a dictionary. It can be set as follows:

            self._token_indexers = {"tokens": PretrainedTransformerIndexer("microsoft/DialoGPT-small")}

            Source https://stackoverflow.com/questions/66810883

            QUESTION

            ImportError: cannot import name 'AutoModelWithLMHead' from 'transformers'
            Asked 2020-Jul-30 at 16:53

            This is literally all the code that I am trying to run:

            ...

            ANSWER

            Answered 2020-Jul-30 at 16:53

            I solved it! Apperantly AutoModelWithLMHead is removed on my version.

            Now you need to use AutoModelForCausalLM for causal language models, AutoModelForMaskedLM for masked language models and AutoModelForSeq2SeqLM for encoder-decoder models.

            So in my case code looks like this:

            Source https://stackoverflow.com/questions/63141267

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install DialoGPT

            We created a demo script demo.py to ease the difficulty of the deployment of this system. The demo.py contains a pipeline of model downloading, data extraction, data preprocessing and model training over a dummy dataset within one commandline.

            Support

            Please contact DialoGPT@microsoft.com if you have any questions/suggestions. However, the response will be sporadic. Please expect delay.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/microsoft/DialoGPT.git

          • CLI

            gh repo clone microsoft/DialoGPT

          • sshUrl

            git@github.com:microsoft/DialoGPT.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link