treebank skeleton
This commit is contained in:
parent
bdf02e42ae
commit
7e9468d8f8
@ -11,4 +11,7 @@ end
|
||||
include("cmudict.jl")
|
||||
using .CMUDict
|
||||
|
||||
include("sentiment.jl")
|
||||
using .Sentiment
|
||||
|
||||
end
|
||||
|
21
src/data/sentiment.jl
Normal file
21
src/data/sentiment.jl
Normal file
@ -0,0 +1,21 @@
|
||||
module Sentiment
|
||||
|
||||
using ..Data: deps
|
||||
|
||||
function load()
|
||||
isfile(deps("stanfordSentimentTreebank.zip")) ||
|
||||
download("http://nlp.stanford.edu/~socherr/stanfordSentimentTreebank.zip",
|
||||
deps("stanfordSentimentTreebank.zip"))
|
||||
return
|
||||
end
|
||||
|
||||
getfile(r, name) = r.files[findfirst(x -> x.name == name, r.files)]
|
||||
|
||||
function loadtext()
|
||||
r = ZipFile.Reader(deps("stanfordSentimentTreebank.zip"))
|
||||
sentences = readstring(getfile(r, "stanfordSentimentTreebank/datasetSentences.txt"))
|
||||
close(r)
|
||||
return sentences
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user