taishi-i / nagisa

A Japanese tokenizer based on recurrent neural networks
https://huggingface.co/spaces/taishi-i/nagisa-demo
MIT License
384 stars 22 forks source link

Failed to install on docker on pi4b #33

Closed lokxii closed 8 months ago

lokxii commented 8 months ago

I have the following Dockerfile

FROM python:3.10-bookworm

WORKDIR /app
COPY . .
RUN pip install -r requirements.txt

CMD ["python", "main.py"]

where content of requirements.txt is

atproto == 0.0.42
python-dotenv == 1.0.1
nagisa == 0.2.11

I am getting error

ERROR: Could not find a version that satisfies the requirement DyNet38 (from nagisa) (from versions: none)
ERROR: No matching distribution found for DyNet38

How can I resolve it?

taishi-i commented 8 months ago

Hi, @lokxii. Thank you for using nagisa!

How about using python:3.10 instead of python:3.10-bookworm? I was able to build in my environment with the following dockerfile.

FROM python:3.10

WORKDIR /app
COPY . .
RUN pip install -r requirements.txt

CMD ["python", "main.py"]

If you need to use nagisa with python:3.10-bookworm, please contact us again. Thank you.

lokxii commented 8 months ago

Sorry, I forgot to mention that I am building on a raspberry pi 4b

taishi-i commented 8 months ago

Sorry. At this time, nagisa does not support the CPU of ARM processors such as Raspberry Pi.

Since I can't provide an immediate solution, why not try using an alternative, Janome, which is implemented in Pure Python? I think this will probably work.

lokxii commented 8 months ago

Thank you for your reply! I really like nagisa but it becomes a deal breaker when I can't deploy my app using nagisa on my pi4b. I will try other alternatives.

taishi-i commented 4 months ago

Hi @lokxii. I apologize for any inconvenience caused.Thank you for your patience. Nagisa is now available on Raspberry Pi 4. It is compatible with Python versions 3.9 to 3.12.

Please install nagisa using the following command.

pip install nagisa

Here is the basic usage.

import nagisa

text = 'Pythonで簡単に使えるツールです'
words = nagisa.tagging(text)
print(words)
#=> Python/名詞 で/助詞 簡単/形状詞 に/助動詞 使える/動詞 ツール/名詞 です/助動詞

# Get a list of words
print(words.words)
#=> ['Python', 'で', '簡単', 'に', '使える', 'ツール', 'です']

# Get a list of POS-tags
print(words.postags)
#=> ['名詞', '助詞', '形状詞', '助動詞', '動詞', '名詞', '助動詞']

If you encounter any installation errors, please comment again. Thank you for considering the use of nagisa. I hope this tool will be useful to you.