question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spacy.Initialize() Throws Exception

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Billyishcommented, Jan 14, 2022

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.

0reactions
theolivenbaumcommented, Jan 14, 2022

@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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found