Closed nidhaloff closed 3 years ago
Is the fact that QCRI is not included in the cli related to this error that I got?
from deep_translator import (QCRI)
>>> translated = QCRI("XXXXXXXXXXXXXXXXXXXXX").translate(source='en', target='ar', domain="news", text=text) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/deep_translator/qcri.py", line 77, in translate translation = res["translatedText"] KeyError: 'translatedText'
@devrobgilb No certainly not. Can you provide an example? It is working fine when I try it. Can you show your code or your example
Hey @nidhaloff I like using cli whenever I can. The projects excites me and would like to start contributing.
Is this issue still open? If so, I would like to come back with some propositions and POC.
Best regards, Inanc
hey @inancg thanks for joining. The issue is still open yes. Feel free to check it out and make a pull request or create an issue if you have new ideas. I would like to see new developers joining the project, this is why I'm letting the issue open in the first place
Hey @nidhaloff ! Just came across this issue. This module seems interesting. Just wanted to know if this issue is still open and if I could I start contributing to it?
P.S. I am new to open source contributions.
Thanks & Regards, Bighnesh Sahoo
@bigsbunny yeah sure, you can start working on it. Feel free to make a PR
@bigsbunny @inancg are you still working on this or not? please give me a feedback asap
Hi @nidhaloff, I am interested in working on this issue and get more familiar with open-source, and this issue seems fairly easy enough for me.
@tuyenhn Hi, sure thanks for joining. You can start working on this. You can consider using the click library if you are familiar with it https://click.palletsprojects.com/en/8.0.x/
Hi @nidhaloff, it seems like all of the unimplemented translators (DeepL, QCRI, Yandex, Microsoft and Papago) requires API keys or something similar. Do you want me to also create an --api-key
argument of some sort for those translators?
Besides that, I have refactored the cli into using the click library.
@tuyenhn Awesome! thank you. Yes exactly, an --api-key
is definitely needed in that case
I'm not sure if this will be fixed by any of those changes, but I was looking at this the last few days, and the main issue with the translate function seems to be a problem with the QCRI API for the issue that @devrobgilb mentioned:
The 'translatedText' key is missing from the QCRI parameters found here: https://mt.qcri.org/api/v1/translate?parameters.
If I run the QCRI class you made and replace 'translatedText' with 'success', I get: :TranslationNotFound: HELLO WORLD --> No translation was found using the current translator. Try another translator?"
All of this combined, I don't think anything's wrong with your code, but that the QCRI API is broken for translation.
Maybe I'm missing something, but that's what I've been able to gather, this is also my first jab at open source contributions, so take it with a grain of salt.
@Duncanr-glitch This is not the right place to discuss the issue. Can you please open an issue and explain how to reproduce it?
Description
The cli functionality needs to be updated since more translators are now integrated. This is a fair easy issue for new comers to help people contribute to the project.
PS: consider using click https://click.palletsprojects.com/en/8.0.x/