ericproffitt/TopicModelsVB.jl

stop_corp!(corp): error : dataset_path not defined

Closed this issue · 15 comments

stop_corp!(corp): error : dataset_path not defined
win 10, Julia ver 1.3

Would you suggest, how to define dataset_path?

Thank you in advance.

Hi Valerii,

So I actually just came across this bug several days ago. If you download the latest version of the package, it should work.

Also, you're better off removing stop words using the fixcorp! function, i.e.

fixcorp!(corp, stop=true, trim=true)

Hi Valerii,

So I actually just came across this bug several days ago. If you download the latest version of the package, it should work.

Also, you're better off removing stop words using the fixcorp! function, i.e.

fixcorp!(corp, stop=true, trim=true)

I've tried fixcorp!(corp, stop_corp=true, trim_corp=true), but it gives the same error.

P.s. previous updated pages (and after try second times by reinstall the page).

Thank you for your help.

It seems you should change the line 540 Corpus.jl by this
datasets_path = joinpath(split(@__DIR__, '/')[1][1:end-3], "datasets")

and additional line544:
dataset_path to datasets_path

I've tried fixcorp!(corp, stop_corp=true, trim_corp=true), but it gives the same error.

I've updated the argument names, it should be,

fixcorp!(corp, stop=true, trim=true)

It seems you should change the line 540 Corpus.jl by this
datasets_path = joinpath(split(@DIR, '/')[1][1:end-3], "datasets")

and additional line544:
dataset_path to datasets_path

The current version works for me, can you confirm that it still doesn't work for you with the latest version of the package?

I've tried fixcorp!(corp, stop_corp=true, trim_corp=true), but it gives the same error.

I've updated the argument names, it should be,

fixcorp!(corp, stop=true, trim=true)

It seems you should change the line 540 Corpus.jl by this
datasets_path = joinpath(split(@DIR, '/')[1][1:end-3], "datasets")
and additional line544:
dataset_path to datasets_path

The current version works for me, can you confirm that it still doesn't work for you with the latest version of the package?

I remove old version by Pkg.rm() and add the new version, so It is supposed to give the latest version.

You need to make sure that you're running the following,

pkg> add https://github.com/ericproffitt/TopicModelsVB.jl

The version currently in the official listing is outdated.

You need to make sure that you're running the following,

pkg> add https://github.com/ericproffitt/TopicModelsVB.jl

The version currently in the official listing is outdated.

I am sorry, but it doesn't work.
You should replace 545 line by this code
datasets_path = joinpath(split(@__DIR__, '/')[1][1:end-3], "datasets")

The current version of the package works on my machine, so I'm wondering if generating this path needs to be customized differently for Windows/Mac.

Can you tell me what the path is for the TopicModelsVB package on your machine, as well as what datasets_path is currently defined as?

The current version of the package works on my machine, so I'm wondering if generating this path needs to be customized differently for Windows/Mac.

Can you tell me what the path is for the TopicModelsVB package on your machine, as well as what datasets_path is currently defined as?

C:\Users\vbaidin\.julia\packages\TopicModelsVB\6GW70\

Ok so if that's where the TopicModelsVB package is located, then the datasets_path variable should be,

C:\Users\vbaidin\.julia\packages\TopicModelsVB\6GW70\datasets

are you able to confirm if this is its value?

You may have to temporarily patch the stop_corp! function inside Corpus.jl to print it.

Ok so if that's where the TopicModelsVB package is located, then the datasets_path variable should be,

C:\Users\vbaidin\.julia\packages\TopicModelsVB\6GW70\datasets

are you able to confirm if this is its value?

You may have to temporarily patch the stop_corp! function inside Corpus.jl to print it.

Yes, it's right
I use the line of code, that send you here previously.

Thank you for your help

Ok, now it all makes sense to me.

Because Windows uses backslashes for paths, while Linux and Mac use forward slashes, your workaround was basically not splitting on anything, so you just took the first element, and then removed \src from the path string.

Since the splitting is not necessary, here is a simpler solution which will work for both Windows and Mac/Linux,

datasets_path = joinpath((@__DIR__)[1:end-3], "datasets")

I'll push this change to master in a bit.

datasets_path = joinpath((@__DIR__)[1:end-3], "datasets")

yes, it works. thank you!!!

Ok, so I just realized that Windows uses backslashes for its paths, while Mac and Linux use forward slashes.

Could you try modifying line 545 in Corpus.jl, so that it is,

datasets_path = joinpath(join(split(@__DIR__, '\')[1:end-1], '\'), "datasets")

And see if that fixes the problem?

there should be double \

`datasets_path = joinpath(join(split(@__DIR__, '\\')[1:end-1], '\\'), "datasets")`

Ok, changes have been pushed to master, so if you download the newest version it should work on all platforms.

I'll close this issue, but if for some reason it still doesn't work, please feel free to reopen.