0

I want to input conversation data as an input to the gpt2 model from huggingface transformers.

====Example====

A: Where did you meet David?
B: I met him at the central park.
A: Weren't he quite strange that day?

=> predicted B: Not at all, why?

===============

Like the upper example, I want to input some conversation data to the transformer and get a reply from the pretrained model(gpt2). Can anybody tell me how?

NAME
  • 1
  • 1
  • FYI, SO is not a service. Please provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) with code, data, errors, current & expected output, as [formatted text](https://stackoverflow.com/help/formatting) & you're expected to [try to solve the problem first](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users). Show your effort. – kkgarg Aug 14 '21 at 21:53
  • You have to concatenate the conversation history with alternating separator tag between the two speaker utterance. You can follow [this article](https://medium.com/huggingface/how-to-build-a-state-of-the-art-conversational-ai-with-transfer-learning-2d818ac26313) and [the corresponding code](https://github.com/huggingface/transfer-learning-conv-ai) to get an idea. – biplob biswas Oct 07 '21 at 02:54

0 Answers0