treebank skeleton
This commit is contained in:
parent
bdf02e42ae
commit
7e9468d8f8
1
REQUIRE
1
REQUIRE
@ -5,3 +5,4 @@ MacroTools 0.3.3
|
|||||||
NNlib
|
NNlib
|
||||||
ForwardDiff
|
ForwardDiff
|
||||||
Requires
|
Requires
|
||||||
|
ZipFile
|
||||||
|
@ -11,4 +11,7 @@ end
|
|||||||
include("cmudict.jl")
|
include("cmudict.jl")
|
||||||
using .CMUDict
|
using .CMUDict
|
||||||
|
|
||||||
|
include("sentiment.jl")
|
||||||
|
using .Sentiment
|
||||||
|
|
||||||
end
|
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