#HeroProApp Screenshots
##iOS HTML5/Native (pinned to start screen) Click here to see the screenshots
| try: | |
| import faiss | |
| except: | |
| !pip install faiss-cpu -q | |
| import faiss | |
| # Build the index | |
| d = embeddings.shape[1] # Dimension | |
| index = faiss.IndexFlatL2(d) |
| class AttentionWithContext(Layer): | |
| """ | |
| Attention operation, with a context/query vector, for temporal data. | |
| Supports Masking. | |
| Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] | |
| "Hierarchical Attention Networks for Document Classification" | |
| by using a context vector to assist the attention | |
| # Input shape | |
| 3D tensor with shape: `(samples, steps, features)`. | |
| # Output shape |
| from keras import backend as K, initializers, regularizers, constraints | |
| from keras.engine.topology import Layer | |
| def dot_product(x, kernel): | |
| """ | |
| Wrapper for dot product operation, in order to be compatible with both | |
| Theano and Tensorflow | |
| Args: |
| /* | |
| Basically "web3" comes from Mist, | |
| but "Web3" CAN come from the dapp. | |
| A Dapp has 3 ways to use web3. | |
| 2. and 3. would work when in Mist and outside. | |
| */ | |
| // 1. simply use, web3 comes already defined |
#HeroProApp Screenshots
##iOS HTML5/Native (pinned to start screen) Click here to see the screenshots
| # coding=UTF-8 | |
| from __future__ import division | |
| import re | |
| # This is a naive text summarization algorithm | |
| # Created by Shlomi Babluki | |
| # April, 2013 | |
| class SummaryTool(object): |