pythonPackages.spacy: add models data attr set

Model                   Version
es_core_web_md          1.0.0
fr_depvec_web_lg        1.0.0
en_core_web_md          1.2.1
en_depent_web_md        1.2.1
en_core_web_sm          1.2.0
de_core_news_md         1.0.0
en_vectors_glove_md     1.0.0
This commit is contained in:
Rodney Lorrimar 2017-09-13 18:32:46 +01:00
parent 3b1877f4c0
commit fad89eda77
3 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,42 @@
[{
"pname": "es_core_web_md",
"version": "1.0.0",
"sha256": "0ikyakdhnj6rrfpr8k83695d1gd3z9n60a245hwwchv94jmr7r6s",
"license": "cc-by-sa-40"
},
{
"pname": "fr_depvec_web_lg",
"version": "1.0.0",
"sha256": "0nxmdszs1s5by2874cz37azrmwamh1ngdsiylffkfihzq6s8bhka",
"license": "cc-by-nc-sa-40"
},
{
"pname": "en_core_web_md",
"version": "1.2.1",
"sha256": "12prr4hcbfdaky9rcna1y1ykr417jkhkks2r8l06g8fb7am3pvp3",
"license": "cc-by-sa-40"
},
{
"pname": "en_depent_web_md",
"version": "1.2.1",
"sha256": "0giyr35q5lpp5drpcamyvb5gsjnhj62mk3ndfr49nm1s6d5f6m52",
"license": "cc-by-sa-40"
},
{
"pname": "en_core_web_sm",
"version": "1.2.0",
"sha256": "0vc4l77dcwa9lmzyqdci8ikjc0m2rhasl2zvyba547vf76qb0528",
"license": "cc-by-sa-40"
},
{
"pname": "de_core_news_md",
"version": "1.0.0",
"sha256": "072jz2rdi1nckny7k16avp86vjg4didfdsw816kfl9zwr88iny6g",
"license": "cc-by-sa-40"
},
{
"pname": "en_vectors_glove_md",
"version": "1.0.0",
"sha256": "1jbr27xnh5fdww8yphpvk2brfnzb174wfnxkzdqwv3iyi02zsin6",
"license": "cc-by-sa-40"
}]

View file

@ -0,0 +1,26 @@
{ stdenv, buildPythonPackage, fetchurl, spacy }:
let
buildModelPackage = { pname, version, sha256, license }: buildPythonPackage {
name = "${pname}-${version}";
inherit pname version;
src = fetchurl {
url = "https://github.com/explosion/spacy-models/releases/download/${pname}-${version}/${pname}-${version}.tar.gz";
inherit sha256;
};
propagatedBuildInputs = [ spacy ];
meta = with stdenv.lib; {
description = "Models for the spaCy NLP library";
homepage = "https://github.com/explosion/spacy-models";
license = licenses."${license}";
maintainers = with maintainers; [ rvl ];
};
};
makeModelSet = models: with pkgs.lib; listToAttrs (map (m: nameValuePair m.pname (buildModelPackage m)) models);
in makeModelSet (pkgs.lib.importJSON ./models.json)
# cat models.json | jq -r '.[] | @uri "https://github.com/explosion/spacy-models/releases/download/\(.pname)-\(.version)/\(.pname)-\(.version).tar.gz"' | xargs -n1 nix-prefetch-url

View file

@ -27277,6 +27277,8 @@ EOF
spacy = callPackage ../development/python-modules/spacy { };
spacy_models = callPackage ../development/python-modules/spacy/models.nix { };
textacy = callPackage ../development/python-modules/textacy { };
pyemd = callPackage ../development/python-modules/pyemd { };