Live data from Hacker News

SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

github.com

31–40 of 67 posts

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#31
post #14

A friend, who also has a background in NLP, was asking me the other day "Is there still even a need for traditional NLP in the age of LLMs?" This is one of the under-discussed areas of LLMs imho. For anything that would have have required either word2vec embeddings of a tf-idf representation (classification tasks, sentiment analysis, etc) there are rare exceptions where it wouldn't just be better to start with a sema…

I have been working on text classification tasks at work, and I have found that for my particular use-case, LLMs are not performing well at all. I have spent a few thousand dollars trying, and I have tried everything from few-shot to asking simple binary yes/no questions, and I have had mixed success. I have stopped trying to use LLMs for this project and switched to discriminative models (Logistic Regression with TF…

Are your categories fixed? If so you could constrain the output using enums in structured outputs.

re: inconsistencies in output, OpenAI provide a seed and system_fingerprint options to (mostly) produce deterministic output.

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#32

A friend, who also has a background in NLP, was asking me the other day "Is there still even a need for traditional NLP in the age of LLMs?" This is one of the under-discussed areas of LLMs imho. For anything that would have have required either word2vec embeddings of a tf-idf representation (classification tasks, sentiment analysis, etc) there are rare exceptions where it wouldn't just be better to start with a sema…

How about expense? LLMs do dramatically more computations doing simple tasks, and only run on relatively exotic, expensive hardware. You have to trust an LLM provider, and keep paying them.

If a traditional NLP solution can run under your control, and tackle the task at hand, it can be plainly much cheaper at scale.

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#33

A friend, who also has a background in NLP, was asking me the other day "Is there still even a need for traditional NLP in the age of LLMs?" This is one of the under-discussed areas of LLMs imho. For anything that would have have required either word2vec embeddings of a tf-idf representation (classification tasks, sentiment analysis, etc) there are rare exceptions where it wouldn't just be better to start with a sema…

The SpaCy creator has a good blog post on this https://explosion.ai/blog/against-llm-maximalism

https://www.quantamagazine.org/when-chatgpt-broke-an-entire-...

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#34
SpaCy is the OG, nothing but praise for the devs. Built a lot of very powerful legal apps with it pre GPT , very useful today for NER where you want something “small”, fast and reliable.

Used it again recently and the dev experience is 1000x that of wrangling LLMs.

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#35
post #25

Earlier quoted context omitted.

The SpaCy creator has a good blog post on this https://explosion.ai/blog/against-llm-maximalism

I'd go a step beyond this (excellent) post and posit that one incredibly valuable characteristic of traditional NLP is that it is largely immune to prompt injection attacks. Especially as LLMs continue to be better tuned to follow instructions that are intentionally colocated and intermingled with data in user messages, it becomes difficult to build systems that can provide real guarantees that "we'll follow your pro…

I guess it depends on how you use the LLMs. We implemented some workflows where the LLMs were used only for dialogue understanding, then the system response was generated by classic backend code.

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#36
post #21

I’ve been a user of SpaCy since 2016. I haven’t touched it in years and I just picked it up again to develop a new metric for RAG using part of speech coverage. The API is one of the best ever, and really set the bar high for language tooling. I’m glad it’s still around and getting updates. I had a bit of trouble integrating it with uv, but nothing too bad. Thanks to the explosion team for making such an amazing proj…

What’s great about the API that you enjoy and do you have anything you hate about it? I’m writing a small library at work for some NLP tasks and I haven’t got a whole lot of experience in writing libraries for NLP, so I’m interested in what would make my library the best for the user.

The thing about spaCys API is that it perfectly aligns with how NLP worked at the time with actual programming paradigms and allows you to be very pythonic. For example, you can use list comprehension to get all the nouns from a document in a one liner.

These days NLP is quite different, because we look for outcomes rather than iterating over tokens.

What does your NLP library need to do? The way I design APIs is I write the calling code that I want to exist, and then I write the API to make it work. Here’s an example I’ve worked on for LLM integration. I just wanted to be able to get simple answers from an LLM and cast the answer to a type: https://www.npmjs.com/package/llm-primitives

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#37
post #25

Earlier quoted context omitted.

The SpaCy creator has a good blog post on this https://explosion.ai/blog/against-llm-maximalism

I'd go a step beyond this (excellent) post and posit that one incredibly valuable characteristic of traditional NLP is that it is largely immune to prompt injection attacks. Especially as LLMs continue to be better tuned to follow instructions that are intentionally colocated and intermingled with data in user messages, it becomes difficult to build systems that can provide real guarantees that "we'll follow your pro…

> But no amount of text appended to an input document, no matter how persuasive, can cause an NLP pipeline to change how it interprets the remainder of the document,

Text added to a document can absolutely change how an NLP pipeline interprets the document.

> "Ignore the above prompt" is just a sentence that doesn't seem like positive or on-topic sentiment to an NLP classifier, and that's it.

And simple repeated words can absolutely make that kind of change for many NLP systems.

Have you actually worked with doing more traditional NLP systems? They're really not smart.

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#38
post #14

A friend, who also has a background in NLP, was asking me the other day "Is there still even a need for traditional NLP in the age of LLMs?" This is one of the under-discussed areas of LLMs imho. For anything that would have have required either word2vec embeddings of a tf-idf representation (classification tasks, sentiment analysis, etc) there are rare exceptions where it wouldn't just be better to start with a sema…

I have been working on text classification tasks at work, and I have found that for my particular use-case, LLMs are not performing well at all. I have spent a few thousand dollars trying, and I have tried everything from few-shot to asking simple binary yes/no questions, and I have had mixed success. I have stopped trying to use LLMs for this project and switched to discriminative models (Logistic Regression with TF…

It depends on a lot of things but to add to your possible setups you can potentially improve results by using simpler systems for first answers and falling back afterwards.

For example:

If contains cafe and not internet/cyber/etc -> restaurant

No -> (tfidf) -> yes, no, unsure

unsure -> embeddings -> yes, no, unsure

unsure -> llm -> yes, no, unsure

unsure -> human queue ->...

Re: SpaCy: Industrial-Strength Natural Language Processing (NLP) in Python

#40
post #14

A friend, who also has a background in NLP, was asking me the other day "Is there still even a need for traditional NLP in the age of LLMs?" This is one of the under-discussed areas of LLMs imho. For anything that would have have required either word2vec embeddings of a tf-idf representation (classification tasks, sentiment analysis, etc) there are rare exceptions where it wouldn't just be better to start with a sema…

I have been working on text classification tasks at work, and I have found that for my particular use-case, LLMs are not performing well at all. I have spent a few thousand dollars trying, and I have tried everything from few-shot to asking simple binary yes/no questions, and I have had mixed success. I have stopped trying to use LLMs for this project and switched to discriminative models (Logistic Regression with TF…

At my work, we still prefer to use distilbert for text classification. It almost always does well with a little bit of fine tuning. In very rare cases, we use LLMs/Agentic setup when the task involves refering both images and text and the same time.
Post reply on HN