Spacy.Initialize() Throws Exception
See original GitHub issueDescribe the bug
I have a command-line .NET 5.0 application that uses Catalyst
and Catalyst.Spacy
libraries (both have version 1.0.23862). I was following this guide to build a minimal application to analyze text with spacy.
When I run the sample I get the following exception message:
Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key '3.2.0' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Catalyst.Spacy.LoadModelsData(ModelSize modelSize, Language[] languages)
at Catalyst.Spacy.Initialize(ModelSize modelSize, Language[] languages)
at catalyst_test.Program.RunSpacy() in C:\Users\andru\source\repos\catalyst_test\catalyst_test\Program.cs:line 51
at catalyst_test.Program.Main(String[] args) in C:\Users\andru\source\repos\catalyst_test\catalyst_test\Program.cs:line 19
at catalyst_test.Program.<Main>(String[] args)
To Reproduce Here is below the code to reproduce the issue:
using (await Spacy.Initialize(Spacy.ModelSize.Small, Language.Any, Language.English))
{
var nlp = Spacy.For(Spacy.ModelSize.Small, Language.English);
var doc = new Document("Bill Gates it the founder of Microsoft", Language.English);
nlp.ProcessSingle(doc);
Console.WriteLine(doc.ToJson());
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Language Processing Pipelines
Initialize it for name in pipeline: nlp.add_pipe(name, config={...}) # 3. ... AttributeRuler, Assign token attribute mappings and rule-based exceptions.
Read more >Why does R freeze when I initialize SpacyR? - spacy
Every time I successfully install spacyR with spacy_install() , but whenever I run spacy_initialize , my R console shows that it registers ...
Read more >Cannot initialize tagger in spacy train or debug data. #6567
I am migrating data from 2.3 to 3.0 to test out NER accuracy. While running spacy train or spacy debug data , i...
Read more >Installation problem with spacy-nightly v2.0.0a14
I've been trying to install the newest version of SpaCy-nightly in ... in init spacy.tokens.doc() SystemError: initialization of morphology ...
Read more >spaCy NLP Tutorial
spaCy is a library for natural language processing. This spaCy tutorial explains the introduction to spaCy and features of spaCy for NLP.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @theolivenbaum I was about to post to say that I have worked out the issue myself. Good to have the package update though! I will check out your update.
@lightel @Billyish just pushed a fix that should handle this case, could you test when it’s published to nuget - should take an hour to be online (package version 1.0.24611)