mozilla-extensions / firefox-voice

Firefox Voice is an experiment in a voice-controlled web user agent
Mozilla Public License 2.0
286 stars 122 forks source link

Add text summarization intents #82

Open ianb opened 5 years ago

ianb commented 5 years ago

We could support intents based on text summaries of an article:

Presumably we'd just use some text summarization service

GangaChatrvedi commented 4 years ago

@ianb Can you suggest some apis that we can use for this. The one I am looking at is https://deepai.org/machine-learning-model/summarization

ianb commented 4 years ago

@GangaChatrvedi I'm not really sure, I haven't thought it through too much.

Though the first part will be getting the text of the web page. I would recommend using Readability, which is the same library Firefox uses for its Reader Mode. But we'd want to install our own version and use it to extract the text from the page (and exclude navigation and other non-article text).

I'd be open to the deepai summarizer... though we don't really have a way to keep the API key private. Maybe we can just include a key and hope it doesn't get used too much for now - it looks like it's not required to enter a credit card, so if it's overused there won't be any surprise bills.

I would recommend not using the deepai library for JavaScript, just because it adds some complexity to get it installed, and it looks like the REST API is very simple.

GangaChatrvedi commented 4 years ago

@ianb One way we can solve the api key problem is that we do not package it with app itself. We ask user to add api with a given link to create one and give it to our extension for us to use it on their behalf.

ianb commented 4 years ago

People need to try things out before committing to signing up for accounts and whatnot. It's no fun if you have to sign up, and I think this could be a fun feature!

It would be fine to put my key in; I've saved it here if you want to try that: https://gist.github.com/ianb/46363208bbf446de507fba41ff5e2dd1

Otherwise we could use a local summarizer (e.g., node-summarizer). To use that I think we'd have to package up the library with browserify, similar to how freezeDry is packaged up. One thing that could be interesting about the TextRank approach it uses is that it identifies sentences, which we can link back into the original article.

GangaChatrvedi commented 4 years ago

Taking a look into it. will respond by tomorrow if i feel comfortable doing it.

GangaChatrvedi commented 4 years ago

@ianb I am able to summarize the text on the web page using Readability for getting the text of the web page and node-summarizer to summarize the text.

As we are using TextRank approach in node-summarizer so according to me, navigation and other non-article text would not get enough rank so these will be ignored if we have enough text.

GangaChatrvedi commented 4 years ago

@ianb can you please asign this issue to me.