Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cocoa-ai/sentimentcoremldemo
😃 iOS11 demo application for sentiment polarity analysis.
https://github.com/cocoa-ai/sentimentcoremldemo
coreml coreml-models ios machine-learning nlp sentiment-analysis sentiment-polarity swift swift4
Last synced: 6 days ago
JSON representation
😃 iOS11 demo application for sentiment polarity analysis.
- Host: GitHub
- URL: https://github.com/cocoa-ai/sentimentcoremldemo
- Owner: cocoa-ai
- License: mit
- Created: 2017-07-13T15:55:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-07T18:53:06.000Z (about 6 years ago)
- Last Synced: 2024-08-03T17:10:03.670Z (3 months ago)
- Topics: coreml, coreml-models, ios, machine-learning, nlp, sentiment-analysis, sentiment-polarity, swift, swift4
- Language: Swift
- Homepage: https://github.com/cocoa-ai
- Size: 1.43 MB
- Stars: 120
- Watchers: 7
- Forks: 21
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sentiment Polarity CoreML Demo
A Demo application using `CoreML` framework for sentiment polarity analysis.
## Model
[CoreML model](https://github.com/cocoa-ai/SentimentCoreMLDemo/blob/master/SentimentPolarity/Resources/SentimentPolarity.mlmodel)
was converted from [Scikit-learn Pipeline](http://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html)
using [coremltools](https://pypi.python.org/pypi/coremltools) python package.The model is based on [LinearSVC](http://scikit-learn.org/stable/modules/generated/sklearn.svm.LinearSVC.html) classifier and is able to distinguish between
positive and negative sentences with **best CV score = 0.801013024602**. It was
trained using [Epinions.com](http://epinions.com) dataset with reviews of
products and services. Accuracy can be improved by using
[TfidfVectorizer](http://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.TfidfVectorizer.html) for feature extraction, but it's not supported by [coremltools](https://pypi.python.org/pypi/coremltools)
at the moment.## Requirements
- Xcode 9
- iOS 11## Installation
```sh
git clone https://github.com/cocoa-ai/SentimentCoreMLDemo.git
cd SentimentCoreMLDemo
open SentimentPolarity.xcodeproj/
```Build the project and run it on a simulator or a device with iOS 11.
## Conversion
```sh
cd Convert
python sentiment.py
```## Author
Vadym Markov, [email protected]
## Credits
- Dataset with [Epinions.com](http://epinions.com) reviews was taken from
[HW3: Sentiment Analysis ](http://boston.lti.cs.cmu.edu/classes/95-865-K/HW/HW3/)## References
- [scikit-learn](http://scikit-learn.org/stable/)
- [Apple Machine Learning](https://developer.apple.com/machine-learning/)
- [CoreML Framework](https://developer.apple.com/documentation/coreml)
- [coremltools](https://pypi.python.org/pypi/coremltools)