semvec/pypi-packages huggingface dataset:
reflex-core 2.1.0
Package for providing core Reflex rule classes
Requires Python: >=3.6

# reflex-core
## reflex
![Reflex](https://avatars3.githubusercontent.com/u/59374073?s=200&v=4)

Reflex enforces security best practices in cloud environments through event-driven automation. Get started by visiting [our documentation](https://docs.reflexivesecurity.com/).

## reflex-core
Package for the core Reflex classes. You can use these classes to easily create Reflex rules to secure your cloud environment (currently only supports AWS).

You'll also want to familiarize yourself with the other parts of Reflex:  
- [reflex-cli](https://www.github.com/reflexivesecurity/reflex-cli), a CLI for creating and managing your Reflex rules and environment.
- [reflex-engine](https://www.github.com/reflexivesecurity/reflex-engine), Terraform modules for deploying required Reflex rule infrastructure.
- [reflex documentation](https://docs.reflexivesecurity.com/), general documentation about deploying reflex.

## Installation
You can install `reflex-core` using `pip`.

`pip install reflex-core`

## Usage
To utilize `reflex-core`, simply import the rule class you want to utilize and implement the required methods.  

```
from reflex_core import AWSRule

class MyRule(AWSRule):
    def extract_event_data(event):
        # Logic for extracting required event info

    def resource_compliant():
        # Logic for determining if the resource configuration is compliant

    # etc
```

For examples, browse provided rules on [Reflexive Security's GitHub](https://www.github.com/reflexivesecurity/).

## License
Reflex is made available under the MPL 2.0 license. For more information view the [LICENSE](https://github.com/reflexivesecurity/reflex-core/blob/master/LICENSE)
WordEmbed 0.2.0
Train and use word embeddings specific to your data
Requires Python: >=3.6

# WordEmbed

## About 
This project allows you to train word embedding on your own data set. It incorporates embedding methods such as 'Glove','Skip-gram' or 'CBOW' and train word embeddings specific to dataset. Morever, this word embeddings can be used as tensorflow layer API too.  

If you want to build a NLP model, word embeddings are the building blocks for most of the NLP model. Current trend give us two option:  
1. Train word embedding along with your final NLP model from the scratch. It is generally used in small and simple models. In this case, as model stacks huge no of layers, vanishing gradients become significant and cause poor training of word embedding.  Example- Tensorflow's Embedding API   
2. Use pre-trained embedding, trained on different dataset. Most of the industrial and real world soltions use this option. It has minor drawback. i.e when our dataset contains words which aren't present in pre-trained embeddings, embedding quality degrades.  Example FastText,GloVe,Word2vec.  

This work addresses this issue by allowing us to train word embedding on specific data and then use this trained embedding as tensorflow layer API and train along with model.   

  
  
  



![](embedding.gif)  

 


## Installation  

LINUX:  
python -m pip install WordEmbed  

WINDOWS:  
py -m pip install WordEmbed  

## Usage  

class Embed(data,embidding_dim,embedding='glove',sampling_window=2, negative_samples=4,Trainable=True)  

Parameters:  

**data**= string, path to raw data file.  

**embedding_dim**= integer, Vector dimension e.g 512  

**embeding**=string,{'glove','skipgram','cbow'} embedding method to be used default to 'glove'  

**sampling_window**= integer, {1<sampling_window<10} Size of sampling window default = 2  

**negative_samples**= integer, {2<negative_samples<15} Size of negative samples default=4  

**Trainable**= bool, if TRUE, Tensorflow layer API is trainable else Freezed if False. Default=True  

**Returns Embed object**  

### Methods  

1. **train()**:  
    Preprocess the raw data and trains the embedding  

### Attributes  

1. **score:**  
   Returns a float value, spearmen correlation w.r.t simlex999. It can be used to compare embeddings from different method.  
   
2. **TfAPI:**  
   Returns tensorflow's layer object. It can be used in tensorflow model building, just like teensorflow's Embedding layer API.  
   
3. **embeddings:**  
   Returns a dictonary with word-embedding pair.  
   
4. **tokenizer:**  
   Returns tensorflow's tokenizer object.  
   
### Example  

![image](https://user-images.githubusercontent.com/39105103/120958342-29b8a580-c775-11eb-9ebd-16dbd477b98e.png)