This repository was archived by the owner on Jan 24, 2024. It is now read-only.
Add Malicious Webpage Detection Example#976
Open
edencfc wants to merge 3 commits intoPaddlePaddle:developfrom
Open
Add Malicious Webpage Detection Example#976edencfc wants to merge 3 commits intoPaddlePaddle:developfrom
edencfc wants to merge 3 commits intoPaddlePaddle:developfrom
Conversation
Add Malicious Webpage Detection Example by PaddleNLP
TCChenlong
reviewed
May 13, 2021
Contributor
TCChenlong
left a comment
There was a problem hiding this comment.
有些地方有问题,comments了,辛苦改下吧 感谢~
| "source": [ | ||
| "# 使用LSTM的恶意网页识别\n", | ||
| "\n", | ||
| "**作者:** [PaddlePaddle](https://github.com/PaddlePaddle) <br>\n", |
Contributor
There was a problem hiding this comment.
作者这里写自己的github名字和链接 感谢大家的贡献~
| "source": [ | ||
| "## 三、网络搭建\n", | ||
| "\n", | ||
| "### 3.1 构造dataloder\n", |
Contributor
There was a problem hiding this comment.
dataloder -> DataLoader
| "import paddlenlp\n", | ||
| "import paddle.nn as nn\n", | ||
| "import paddle.nn.functional as F\n", | ||
| "import paddlenlp as ppnlp\n", |
Contributor
There was a problem hiding this comment.
不推荐这么用,还是 paddlenlp 就好~
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "!pip install lxml -i https://mirror.baidu.com/pypi/simple/\r\n", |
| }, | ||
| "outputs": [], | ||
| "source": [ | ||
| "class SelfDefinedDataset(paddle.io.Dataset):\n", |
There was a problem hiding this comment.
PaddleNLP自定义数据集有多种方式,可参考:https://paddlenlp.readthedocs.io/zh/latest/data_prepare/dataset_self_defined.html
当然,这里的自定义也没问题~
TCChenlong
reviewed
Jun 2, 2021
| "然后接一个线性变换层,完成二分类任务。\n", | ||
| "\n", | ||
| "- `paddle.nn.Embedding`组建word-embedding层\n", | ||
| "- `ppnlp.seq2vec.LSTMEncoder`组建句子建模层\n", |
Contributor
There was a problem hiding this comment.
这里也需要改一下: ppnlp -> paddlenlp
| " padding_idx=padding_idx)\n", | ||
| "\n", | ||
| " # 将word embedding经过LSTMEncoder变换到文本语义表征空间中\n", | ||
| " self.lstm_encoder = ppnlp.seq2vec.LSTMEncoder(\n", |
Contributor
There was a problem hiding this comment.
这里也需要改一下: ppnlp -> paddlenlp
TCChenlong
reviewed
Jun 4, 2021
| "# 提取全部被黑页面样本\r\n", | ||
| "d_page = tempdf[tempdf['flag']=='d']\r\n", | ||
| "# 合并样本\r\n", | ||
| "train_page = pd.concat([n_page,d_page],axis=0)\r\n", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Malicious Webpage Detection Example by PaddleNLP