jesusislam / tldr Goto Github PK
View Code? Open in Web Editor NEWText summarizer for golang using LexRank
License: MIT License
Text summarizer for golang using LexRank
License: MIT License
I tried to use this lib on non-english text and it crashes.
I noticed this:
https://github.com/JesusIslam/tldr/blob/master/tldr.go#L192
Could you change it to use golang's unicode library to determine is it alpha numeric instead?
http://golang.org/pkg/unicode/#IsDigit
http://golang.org/pkg/unicode/#IsLetter
Thanks!
I ran into this issue when I used your code provided in README.md
package main
import (
"fmt"
"io/ioutil"
"github.com/JesusIslam/tldr"
)
func main() {
intoSentences := 3
textB, _ := ioutil.ReadFile("./sample.txt")
text := string(textB)
bag := tldr.New()
result := bag.Summarize(text, intoSentences)
fmt.Println(result)
}
But in your code Summarize function returns two values, i.e. result and error.
For me modifying the line result := bag.Summarize(text, intoSentences)
worked. Please check and modify README.md file.
Hi, I have a sentence tokenizer that I want to use instead of the one used in this package, but I'm a little confused as to what I need to replace to get it working properly.
It looks like createOriginalSentences returns []string
whereas createSentences returns [][]string
.
It'd be nice to have one function to replace the sentence tokenizer so anyone can swap it out.
Try to summarize next text
bag.Summarize("Hello, world. Hello, world. Hello, world.", 1)
and got error
Ranks is empty
I think the summarize function need return Hello, world.
Why this happens?
hi @JesusIslam, Not sure if you are still maintaining this library, but as I don't understand the algorithms used I wanted to ask you if you would have any insights as to why on some inputs (from RSS/Atom feeds) the result is an empty string?
My use-case here is to take RSS/Atom feeds, feed into this library to produce 1-2 sentences and use that as a "summary" with a "Read more" link.
Thanks :)
it's my code
package main
import (
"fmt"
"github.com/JesusIslam/tldr"
"strings"
)
func main() {
intoSentences := 3
words := "loremdkasmsdma skdmlaskldmsla mdaskdlsamskdlasm..............tsk"
leng := strings.Count(words, ".")
if leng > 3 {
bag := tldr.New()
result := bag.Summarize(words, intoSentences)
fmt.Println(result)
}
}
when I run this code I get
panic: runtime error: slice bounds out of range
In function
func (bag *Bag) Summarize(text string, num int) (string, error)
checking number of sentences for output
if num > (len(bag.Ranks)-1) || num < 1 {
num = 1
}
Why len(Ranks)-1
?
May be need:
if num > len(bag.Ranks) || num < 1 {
num = 1
}
?
When running "go install" on the corresponding project, it reports this error:
./main.go:14: multiple-value bag.Summarize() in single-value context
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.