25

Can i do these two things:

  1. Is there any library in dart for Sentiment Analysis?
  2. Can I use Python (for Sentiment Analysis) in dart?

My main motive for these questions is that I'm working on an application in a flutter and I use sentiment analysis and I have no idea that how I do that.

Can anyone please help me to solve this Problem.?
Or is there any way that I can do text sentiment analysis in the flutter app?

zx485
  • 28,498
  • 28
  • 50
  • 59
Hamza Tanveer
  • 323
  • 1
  • 3
  • 7
  • 1
    Looks like you can perform [Sentiment Analysis using Google Cloud natural Language API](https://techwithsach.com/sentiment-analysis-using-google-cloud-natural-language-api/) so guess you could try that long with the [googleapis](https://pub.dartlang.org/packages/googleapis) package. – soupjake Nov 28 '18 at 13:16

5 Answers5

15

visit https://pub.dev/packages/starflut

A new flutter plugin project, which supports flutter to interact with other scripting languages such as python, java, ruby, golang, rust, etc. It is easy to use, supports android and ios platform.

CTech Viral
  • 151
  • 1
  • 3
  • Note that Starflut claims to be open-source, but it is not: https://github.com/srplab/starcore_for_flutter/issues/27 – bitinerant Dec 05 '21 at 19:38
  • I didn't make any research on this, but not sharing code, doesn't mean it is not compliant with MIT. It might just not be uploaded. MIT license doesn't require that does it? Just for clarification, I am not associated with this repository in any way. I don't even know what it is... – nlhnt Feb 09 '22 at 09:53
11

You can create an api using Python then serve it your mobile app (FLUTTER) using http requests. I

sbmalik
  • 464
  • 5
  • 13
2

Yes there are multiple ways to do this I will share two of them which I personally used in the past

  1. Using an API Like 'Text Analysis API' It is freemium and verified, also support HTTP request through flutter here is the link https://rapidapi.com/aylien/api/text-analysis

  2. Using a Starflut package here is the link of the medium article hope it will help you https://medium.com/@ihassanjavaid/how-to-run-python-scripts-on-flutter-d6a4aedb6227

Osama Buzdar
  • 1,115
  • 10
  • 20
  • 2
    The link to the second option does not use starflut. its just flask+flutter requests. I could use this option, but I need to start the python flask server from the flutter app. I don't want the user to start the python script manually for the app to work. –  Jun 03 '21 at 16:48
  • @VaisakMohan yes you are right as mentioned it is the link to a medium article – Osama Buzdar Jun 04 '21 at 06:17
1

There's another package called chaquopy, which uses Chaquopy SDK internally. You can use that package to integrate python scripts into your flutter app. Also an advantage of it, is that it supports pip packages natively.

Jay Dangar
  • 3,271
  • 1
  • 16
  • 35
-4

Since flutter can communicate with platform code(like java), may be u can run python in java way and retrieve the result.See platform-integration

Fred Zeng
  • 44
  • 2