appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.57k stars 3.73k forks source link

[Feature]: Hugging Face Inference API Integration #12631

Closed felixsuarez0727 closed 1 year ago

felixsuarez0727 commented 2 years ago

Docs: https://huggingface.co/inference-api

felixsuarez0727 commented 2 years ago

As of now, tree actions have been added. Need to add seven more, at least, and work on computer vision sample app.

felixsuarez0727 commented 2 years ago

As of now, I have added eight actions. Each of them correspond to a different machine learning model.

image.png

felixsuarez0727 commented 2 years ago

A minor sample app is also ready:

https://app.appsmith.com/app/test-hugging-face/page1-6258fbf50d3d384069c11017

felixsuarez0727 commented 2 years ago

Moving to QA since the integration and the sample app is ready.

btsgh commented 2 years ago

Testcases are available here -

  1. Basic Testcase
  2. Bert-base-uncased-hateexplain
  3. Classificacion-texto-suicida-finetuned-amazon-review
  4. dehatebert-mono-spanish (Sentiment Analysis)
  5. Detect Acoso TwitterEs
  6. Discriminator finetuned clasificacion comentariossuicidas
  7. DistilGPT2
  8. Emotion English DistilRoBERTa-base (Sentiment Analysis)
btsgh commented 2 years ago

Issues found so far -

  1. In Bert-base-uncased-hateexplain - testcase point 2 fails as text is spelt incorrectly. It could be also reworded to - Please enter your sentence here... Bertbaseuncasedhateexplain.png This issue occurs across all the commands

  2. Testcase point 3 - FAILS CURRENTLY - it runs even though the field is blank. It should give an appropriate message that required field is missing. This issue occurs across all the commands

  3. Testcase point 6 - FAILS sometimes - an error pops upbertbase error.png.

  4. In the "Classificacion-texto-suicida-finetuned-amazon-review" command, testcase point 4 - FAILS CURRENTLY - it gives an output exactly the reverse of the expected output. Actual result - Screenshot 2022-06-14 at 9.31.03 PM.png Expected result - Screenshot 2022-06-14 at 9.30.52 PM.png

  5. Testcase5 in Classificacion-texto-suicida-finetuned-amazon-review enter an english text equivalent - (FAILS CURRENTLY - is English supported?)

  6. Testcase4 in dehatebert-mono-spanish (Sentiment Analysis) - (FAILS CURRENTLY - it gives an exact opposite response)

  7. Testcase5 in dehatebert-mono-spanish (Sentiment Analysis) - Currently gives a slightly different response number as below: [ [ { "label": "NON_HATE", "score": 0.7812689542770386 }, { "label": "HATE", "score": 0.218731090426445 } ] ]

  8. Detect Acoso TwitterEs - Testcase4 - FAILS CURRENTLY - gives response which is opposite to the expected.

  9. Detect Acoso TwitterEs - Testcase5 - Output is different from what is seen on this url

  10. Discriminator finetuned clasificacion comentariossuicidas - Testcase4 - Response is not the same as seen in the comparison URL.

  11. Discriminator finetuned clasificacion comentariossuicidas - Testcase5 - Currently fails as the text entered gives an opposite response as below: [ [ { "label": "Texto no suicida", "score": 0.24806660413742065 }, { "label": "Texto Suicida", "score": 0.7519333958625793 } ] ]

  12. DistilGPT2 - Testcase4 fails as the response we get is as below - [ { "generated_text": "text=My%20name%20is%20Clara%20and%20I%20am%20a(%20a),%20a=My%20name%20i%20the%20a%20a" }

Expected response as per this url - [ { "generated_text": "My name is Clara and I am a graduate student. I am working in government and business. I can't tell you that I am a little more than a good citizen of California. I do have some personal problems with my job due to social work" } ]

  1. Emotion English DistilRoBERTa-base (Sentiment Analysis) - Testcase4 - The response received on our interface is different and is as below - [ [ { "label": "anger", "score": 0.11598271876573563 }, { "label": "disgust", "score": 0.00854487530887127 }, { "label": "fear", "score": 0.02401498146355152 }, { "label": "joy", "score": 0.039270929992198944 }, { "label": "neutral", "score": 0.26834872364997864 }, { "label": "sadness", "score": 0.4954221546649933 }, { "label": "surprise", "score": 0.04841558635234833 } ] ] Comparing with the url - https://huggingface.co/j-hartmann/emotion-english-distilroberta-base, the above values are different on our appsmith interface
  2. Emotion English DistilRoBERTa-base (Sentiment Analysis) - Testcase6 - This currently fails. Neutral shows the largest value.
  3. Emotion English DistilRoBERTa-base (Sentiment Analysis) - Testcase7 - This currently fails. Joy shows the largest value.
  4. Emotion English DistilRoBERTa-base (Sentiment Analysis) - Testcase8 - This currently fails. Neutral shows the largest value.
  5. Emotion English DistilRoBERTa-base (Sentiment Analysis) - Testcase10 - This currently does not give the same response as seen in the above url, though anger shows the largest value of 0.5.
felixsuarez0727 commented 2 years ago

Hugging Face Observations

# Question/Observation Related Issue Resolved
1 In Bert-base-uncased-hateexplain - testcase point 2 fails as text is spelt incorrectly - No
2 It runs even though the field is blank. It should give an appropriate message that required field is missing. - No
3 FAILS sometimes - an error pops up - No
4 It gives an output exactly the reverse of the expected output. - No
5 FAILS CURRENTLY - is English supported? - No
6 Gives an exact opposite response - No
7 Currently gives a slightly different response number - No
8 Gives an exact opposite response - No
9 Output is different - No
10 Response is not the same as seen in the comparison URL. - No
11 Gives an exact opposite response - No
12 Fails as the response we get - No
13 The response received on our interface is different - No
14 Currently fails. Neutral shows the largest value. - No
15 Currently fails. Joy shows the largest value. - No
16 Currently fails. Neutral shows the largest value. - No
17 Does not give the same response as seen in the above url - No

Updates about observations

  1. We are going to change this in all the commands

Note: For the other test we need to do more research on the problem

rohan-arthur commented 2 years ago

@felixsuarez0727 can we move this to icebox since we are not actively working on it?

rohan-arthur commented 1 year ago

closing this because we are not working on this currently