АО
Size: a a a
АО
AP
RS
RS
АО
AP
AP
RS
AP
RS
loading multiple copies of the same dynamic library into your address space логично…AP
RS
АО
using PyCall
using Underlines
textblob = pyimport("textblob")
tb = textblob.TextBlob
phrases = ["Javascript is fine", "Julia is great"]
@_ tb.(phrases) |> map(_.sentiment, __) |> first.(__)
# 2-element Array{Float64,1}:
# 0.4166666666666667
# 0.8
RS
RS
AP
VG
@_- это уже встроенный макрос для пайпов?
m
АО
АО
using UrlDownload
using BenchmarkTools
txt = @_ urldownload("https://www.linguistik.uzh.ch/dam/jcr:169bff5c-ac13-457b-9acb-4fe7f1ad5cb0/Harry%20Potter%20and%20the%20Sorcerer.txt", parser=String) |> replace(__, r"[^0-9A-Za-z\n\. ]" => "") |> split(__, "\n") |> split.(__, ".") |> collect(Iterators.flatten(__)) |> strip.(__) |> filter(!isempty, __)
deleteat!(txt, 278)
txt2 = txt[1:500]
function sentiments(tb, x)
@_ tb.(x) |> map(_.sentiment, __) |> first.(__)
end
@btime sentiments($tb, $txt2)
187.112 ms (10508 allocations: 309.17 KiB)
500-element Array{Float64,1}: