semantra icon indicating copy to clipboard operation
semantra copied to clipboard

Default literature folder

Open DrGreyling opened this issue 1 year ago • 3 comments

Hi

I was wondering if it is possible to create a 'default' location where semantra looks for the files if no argument is give on startup? I would like to just run semantra instead of specifying semantra ~/literature/* every time.

Thanks!

DrGreyling avatar Jul 06 '23 15:07 DrGreyling

Or the ability to specify a folder and it os.walks through all the files within? (Or does it do that already?)

endolith avatar Jul 06 '23 17:07 endolith

Not a bad idea! I think the specifying a directory and automatically recursively trawling it is a good idea too. Maybe v0.2 can have default directory as a configurable option (or there can be a default folder it chooses)

freedmand avatar Jul 08 '23 03:07 freedmand

+1 for this feature.

Temporarily, the command below did the job of indexing my Zotero library. Now I wonder whether there is a way to save/export the embeddings so I don't need to recalculate them every time I run semantra.

mapfile -d $'\0' files < <(find ~/Zotero/storage -type f -iname "*.pdf" -print0) && semantra "${files[@]}"

PS: Just found in #6 that embeddings are saved in --semantra-dir. So after the first run you can reload the embeddings with something like:

mapfile -d $'\0' files < <(find <lib_folder> -type f -iname "*.pdf" -print0) && semantra "${files[@]}" --semantra-dir <embeddings-cache-folder>

belisards avatar Aug 04 '23 11:08 belisards