PositiveTechnologies / seq2seq-web-attack-detection

The implementation of the Seq2Seq model for web attack detection. The Seq2Seq model is usually used in Neural Machine Translation. The main goal of this project is to demonstrate the relevance of the NLP approach for web security.
MIT License
155 stars 60 forks source link

Help me! #6

Open buicongthek58 opened 5 years ago

buicongthek58 commented 5 years ago

Hi guy! I tried run your code with python 2.7. and docker, it's run very good. Can you tell me why this source must run with this environment? Now, I want to run this code with python 3 and without docker. How can I do that? Thanks a lot!

amurzina commented 5 years ago

Hi!

  1. you need to install all the requirements for python3.*
  2. and follow the exceptions you've got, you need to fix compatibility errors: python2 style -> python3 style.
buicongthek58 commented 5 years ago

I tried run with python 3. But the results this so different than python 2 and docker Step 0 (epoch 1), average_train_loss = 4.64211, step_loss = 4.64211, time_per_step = 1.017 Step 1 (epoch 2), average_train_loss = 1.03712, step_loss = 0.33868, time_per_step = 1.953 Step 2 (epoch 4), average_train_loss = 0.62684, step_loss = 0.14512, time_per_step = 1.928 Step 3 (epoch 5), average_train_loss = 0.45254, step_loss = 0.07919, time_per_step = 2.058 Step 4 (epoch 7), average_train_loss = 0.35200, step_loss = 0.03626, time_per_step = 1.976

And TP rate, Precision, Recall is 0

buicongthek58 commented 5 years ago

I found the reason why:

vocab.py: try: text = text.decode('utf-8') characters = list(text) except Exception as e: characters = ['<UNK>']

In python3: not need text = text.decode('utf-8') Because it has exception so I can't find that :)) Thanks a lot!

Tikam02 commented 5 years ago

@buicongthek58 so what to do. should i remove that line.

RutujaWanjari commented 4 years ago

@buicongthek58 , @Tikam02 @amurzina , any luck on his front?

I have also converted whole code to 3.6. Notebook is running fine, but Recall and precision are 0.0

amurzina commented 4 years ago

We don't support this version of POC any more. I can just give a suggestion to fit the model again and fix hyperparameters.