Spam Neural Net


Reading time: about 3 minutes
In [1]:
get_ipython().ast_node_interactivity = 'all'
import os
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
from pathlib import Path
import json
In [18]:
comments = []

for path in Path("/home/leo/external/projects/comments/comments").glob("*.json"):
    obj = json.loads(path.read_text())
    encoded = json.dumps([
        obj["url"],
        obj["headers"].get("X-Real-Ip"),
        obj["headers"].get("Cdn-Requestcountrycode"),
        obj["headers"].get("Referer"),
        obj["headers"].get("User-Agent"),
        obj["text"],
    ])
    comments.append(encoded.upper())
In [19]:
print(comments[0])
Out:
["/BLOG/INDEX.HTML", "46.161.11.197", "GB", "HTTPS://WWW.GKBRK.COM/BLOG/INDEX.HTML", "MOZILLA/5.0 (WINDOWS NT 10.0; WIN64; X64) APPLEWEBKIT/537.36 (KHTML, LIKE GECKO) CHROME/83.0.4103.61 SAFARI/537.36/IYA9HEBN-7", "FINANCIAL ROBOT IS YOUR SUCCESS FORMULA IS FOUND. LEARN MORE ABOUT IT. HTTPS://BIG.STARTUPERS.SE/GOTODATE/GO "]
In [4]:
import torch
In [5]:
class TextHasher(torch.nn.Module):
    def __init__(self):
        super().__init__()

        self.encoder = torch.nn.Sequential(
            torch.nn.Linear(nf(1), 2),
            torch.nn.Tanh(),
        )

        self.decoder = torch.nn.Sequential(
            Compressor(2, nf(1)),
        )

    def forward(self, x):
        x = self.encoder(x)
        x = self.decoder(x)
        return x
Out:
[ERROR] SyntaxError: incomplete input (2052264714.py, line 1)

The following pages link here

Citation

If you find this work useful, please cite it as:
@article{yaltirakliwikispamneuralnet,
  title   = "Spam Neural Net",
  author  = "Yaltirakli, Gokberk",
  journal = "gkbrk.com",
  year    = "2024",
  url     = "https://www.gkbrk.com/wiki/spam-neural-net/"
}
Not using BibTeX? Click here for more citation styles.
IEEE Citation
Gokberk Yaltirakli, "Spam Neural Net", November, 2024. [Online]. Available: https://www.gkbrk.com/wiki/spam-neural-net/. [Accessed Nov. 12, 2024].
APA Style
Yaltirakli, G. (2024, November 12). Spam Neural Net. https://www.gkbrk.com/wiki/spam-neural-net/
Bluebook Style
Gokberk Yaltirakli, Spam Neural Net, GKBRK.COM (Nov. 12, 2024), https://www.gkbrk.com/wiki/spam-neural-net/

Comments

© 2024 Gokberk Yaltirakli