I have a JSON file that is an export from telegram chat, it is messages, what I want you…
- User
I have a JSON file that is an export from telegram chat, it is messages, what I want you to do is create a Python script that creates all possible dialogues threats based on ID and ID of the message that the post replying to
heres an example:
[{text:”hi, im bob”, id:1, replying_to:None}, {text:”hi bob, im nick!”, id:2, replying_to:1}, {text:”sup bob, im sara”, id:3, replying_to:1}, {text:”hi, nick”, id:4, replying_to:2}, {text:”hi, sara!”, id:5, replying_to:3}, {text:”hi guys, im bruce!”, id:6, replying_to:None}, {text:”hey bruce”, id:7, replying_to:6},
this is what i want:
- Assistant
[ [ {text: "hi, im bob", id: 1, replying_to: None}, {text: "hi bob, im nick!", id: 2, replying_to: 1}, {text: "hi, nick", id: 4, replying_to: 2} ], [ {text: "hi, im bob", id: 1, replying_to: None}, {text: "hi bob, im nick!", id: 2, replying_to: 1}, {text: "hi, sara!", id: 5, replying_to: 3} ], [ {text: "hi, im bob", id: 1, replying_to: None}, {text: "sup bob, im sara", id: 3, replying_to: 1}, {text: "hi, nick", id: 4, replying_to: 2} ], [ {text: "hi, im bob", id: 1, replying_to: None}, {text: "sup bob, im sara", id: 3, replying_to: 1}, {text: "hi, sara!", id: 5, replying_to: 3} ], [ {text: "hi guys, im bruce!", id: 6, replying_to: None}, {text: "hey bruce", id: 7, replying_to: 6} ] ]