clnnn / chat-summarizer

💬 Real-time chat application prototype that can summarise the entire chat log
8 stars 0 forks source link

Awesome Sauce #1

Open fire17 opened 2 years ago

fire17 commented 2 years ago

Hi there :) lemme say this looks awesome, I've been searching around for "summarize chat conversations python" and came across this project , seems brand new :)

I've yet to try you're code , will check it soon , but just from the Readme it seems like you've made some ui to type up mock conversations. I'm more interested in the function that takes the chat and runs the summarization on it.

my goal is to make a daily digest for a wa group that is really interesting but way too crowded and busy.

at the end of evey day ill send the summary as a message in that group, then me and others can easily check if there's something interesting for us :)

there are cool ways to get wa chat data but even copying messages from wa or wa web, and doing some formatting (automatically eventually) then saving the chat text to a variable or file, and running the model on it will be very cool to see working well.

Thanks for being awesome and tackling this , really feeling the wonders of opensource 💕

fire17 commented 2 years ago

P.S ! thanks for the intro to pipelines transformers & huggingface

i can't believe how simple your app.py is

could you please give an example json for

chat_log​ ​=​ ​json​[​"chatLog"​]

clnnn commented 2 years ago

Hello Tami. I'm glad that you found this project useful. I think that what you need is the summarization-server which expose the API. The request body has the following format:

{
 chatLog: "Jake: Hello/n Michael: hi\n"
}

where each chat bubble is splitter by a newline \n.

I call the summarisation service directly from the UI:

  public summarize(messages: Message[]): Observable<{ summaryText: string }> {
    let chatLog = '';
    for (const message of messages) {
      const log = `${message.sender}: ${message.message}\n`;
      chatLog += log;
    }
    return this.http.post<{ summaryText: string }>('http://localhost:9000', {
      chatLog: chatLog,
    });
  }

if you have other questions please let me know :)