asli

asli / selfexplaining_tf2_movie_sentiment / 0.1.2

TF2 Sentiment Analysis Model with integrated SHAP explainer

Royalty Free
Å sentiment analysis model on Tensorflow2, using SHAP to optionally explain the feature importance for each word.
Language
Python3
Metrics
API Calls - 31 Avg call duration - 37.81sec
Permissions
The Algorithm Platform License is the set of terms that are stated in the Software License section of the Algorithmia Application Developer and API License Agreement. It is intended to allow users to reserve as many rights as possible without limiting Algorithmia's ability to run it as a service. Learn More
This is necessary for algorithms that rely on external services, however it also implies that this algorithm is able to send your input data outside of the Algorithmia platform.
This allows an algorithm to compose sophisticated functionality using other algorithms as building blocks , however it also carries the potential of incurring additional royalty and usage costs from any algorithm that it calls .

Run an Example

Input
Output
{
  "forceplot_path": "data://.algo/perm/forceplot_71b23590-6840-4035-accb-502d5c3a837d.html",
  "prob": 0.000933706760406494,
  "shap_expected_value": [
    0.4081003285444092
  ],
  "shap_values": [
    -0.005782497345988612,
    0,
    0,
    -0.0019609847267183476,
    -0.004598637818469708,
    -0.006820061628555536,
    -0.0029696993219395576,
    0,
    -0.034017862827617,
    -0.0016104048266407725,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.004991920533002316,
    0,
    0,
    0,
    0,
    -0.00571694077986433,
    0,
    0,
    0,
    -0.007270679432616889,
    0,
    0,
    -0.010577691790261363,
    -0.00941870586909467,
    -0.004526276231283453,
    0,
    0,
    -0.00859455752775884,
    0,
    -0.004659119141136002,
    -0.001803709674362941,
    0,
    -0.015453077208422742,
    0.031268517624961904,
    0,
    0,
    0,
    0,
    -0.01793845435818919,
    0,
    0,
    0,
    -0.0029502016615040524,
    -0.003766993530127896,
    0,
    0,
    0,
    0,
    -0.013093702284581708,
    0,
    0,
    -0.02004879604393807,
    -0.0027004732739594473,
    0,
    0,
    0,
    0,
    0,
    -0.01192272892914586,
    0,
    0,
    -0.003875613177665077,
    0,
    0,
    0,
    -0.0011093552052922305,
    -0.004437168353289736,
    0,
    -0.024835815295649613,
    -0.021499845924731698,
    0,
    -0.0008896873220953228,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.023726867138093553,
    0,
    -0.0009816804246272903,
    0,
    0,
    0,
    -0.001048753688817735,
    -0.00955326093944424,
    0,
    0,
    0.028147592729597472,
    -0.011840927715773886,
    0,
    -0.02119886486712003,
    0,
    0,
    0,
    0,
    -0.015725683921565127,
    0,
    -0.01603521137603757,
    -0.003635083760893755,
    0,
    0,
    0,
    0,
    0,
    -0.007151889032137006,
    0,
    0,
    0,
    0,
    -0.007883208705204606,
    -0.0051836586311359845,
    -0.010154814194478218,
    0,
    0,
    -0.00453938693456676,
    0,
    0,
    0,
    -0.005905730146990182,
    0,
    0,
    0,
    0,
    -0.031796246699356205,
    -0.0046763524113149005,
    0,
    -0.009397082798216345,
    0,
    0.024105164541226135,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.0015461266692862394,
    0,
    0,
    -0.003813522798043454,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.002363962741686234,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.004429709743113587,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.0027941793961076856,
    0,
    0,
    -0.003799914110330239,
    0,
    -0.005385384234752048,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.0033884429704237606,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.0028720284614883115,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.00529486253397754,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    -0.002332055676545819,
    0,
    0,
    0,
    0,
    0,
    0,
    0.001010892342113212,
    0,
    -0.003402234256470016,
    0,
    0,
    0,
    0,
    0
  ]
}

Install and Use

Install

Install the Algorithmia CLI client by running:

curl -sSLf https://algorithmia.com/install.sh | sh

Then authenticate by running:

$ algo auth
# When prompted for api endpoint, hit enter
# When prompted for API key, enter your key: YOUR_API_KEY
CLI Install Docs

Use



    algo run asli/selfexplaining_tf2_movie_sentiment/0.1.2 -d '{"text":"<START> this has to be one of the worst films of the 1990s when my friends i were watching this film being the target audience it was aimed at we just sat watched the first half an hour with our jaws touching the floor at how bad it really was the rest of the time everyone else in the theatre just started talking to each other leaving or generally crying into their popcorn that they actually paid money they had <UNK> working to watch this feeble excuse for a film it must have looked like a great idea on paper but on film it looks like no one in the film has a clue what is going on crap acting crap costumes i can't get across how <UNK> this is to watch save yourself an hour a bit of your life <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD>", "explain":true}' --timeout 300
  
CLI Docs