treebank skeleton

This commit is contained in:
Mike J Innes 2017-11-02 11:41:28 +00:00
parent bdf02e42ae
commit 7e9468d8f8
3 changed files with 25 additions and 0 deletions

View File

@ -5,3 +5,4 @@ MacroTools 0.3.3
NNlib
ForwardDiff
Requires
ZipFile

View File

@ -11,4 +11,7 @@ end
include("cmudict.jl")
using .CMUDict
include("sentiment.jl")
using .Sentiment
end

21
src/data/sentiment.jl Normal file
View 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