Skip to content

How to solve Spanish lemmatization problems with SpaCy?

When trying lemmatize in Spanish a csv with more than 60,000 words, SpaCy does not correctly write certain words, I understand that the model is not 100% accurate. However, I have not found any other solution, since NLTK does not bring a Spanish core. A friend tried to ask this question in Spanish Stackoverfl…

Gaussian filter in PyTorch

I am looking for a way to apply a Gaussian filter to an image (tensor) only using PyTorch functions. Using numpy, the equivalent code is The closest suggestion I found is based on this post: But it gives me the error NameError: name ‘gaussian_weights’ is not defined. How can I make it work? Answer…

Saving an output of a program in python as an image

I need to save an image of a chessboard, like the one created by this code: The output is the starting chessboard: How can I save this image and print it (for example inside a function)? Is there a unique package for these things in python? If I try to print the board (typing print (board)) I get a string

use ft2232H on lattice machXO3 dev. board

first sorry if this is a simple question but I can’t figure this out. I have this development board and on page 19 on the kits user guide the block diagram shows a RS232 line and on page 20 and 22 the schematic show the pins I need to connect to use RS232. My problem is that, despite being able

Changing monkeypatch setattr multiple times

I am trying to test code that depends on a third party and would like to use monkeypatch to replicate what I expect a request will return. Here is a minimal example of the code that I have. For my tests, I have something like the following: How can I monkeypatch each of the calls to requests.get using monkeyp…

Unable to call function with self

I’m writing a simple code snippet here, but unable to run the code It errors out with “AttributeError: ‘str’ object has no attribute ‘functiona’” Unable to call it with self. However, if I provide test.functiona(a) it works fine. Few of other code samples works with self.fu…