cssupport / mobilebert-sql-injection-detect

huggingface.co
Total runs: 684
24-hour runs: 0
7-day runs: -127
30-day runs: -2.3K
Model's Last Updated: Januar 22 2025
text-classification

Introduction of mobilebert-sql-injection-detect

Model Details of mobilebert-sql-injection-detect

Model Card for Model ID

Based on google/mobilebert-uncased (MobileBERT is a thin version of BERT_LARGE, while equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks). This model detects SQLInjection attacks in the input string (check How To Below). This is a very very light model (100mb) and can be used for edge computing use cases. Used dataset from Kaggle called SQl_Injection . Please test the model before deploying into any environment . Contact us for more info: support@cloudsummary.com

Model Details
Model Description
Model Sources

Please refer google/mobilebert-uncased for Model Sources.

How to Get Started with the Model

Use the code below to get started with the model.

import torch
from transformers import MobileBertTokenizer, MobileBertForSequenceClassification


device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
tokenizer = MobileBertTokenizer.from_pretrained('google/mobilebert-uncased')
model = MobileBertForSequenceClassification.from_pretrained('cssupport/mobilebert-sql-injection-detect')
model.to(device)
model.eval()

def predict(text):
    inputs = tokenizer(text, padding=False, truncation=True, return_tensors='pt', max_length=512)
    input_ids = inputs['input_ids'].to(device)
    attention_mask = inputs['attention_mask'].to(device)

    with torch.no_grad():
        outputs = model(input_ids=input_ids, attention_mask=attention_mask)

    logits = outputs.logits
    probabilities = torch.softmax(logits, dim=1)
    predicted_class = torch.argmax(probabilities, dim=1).item()
    return predicted_class, probabilities[0][predicted_class].item()


#text = "SELECT * FROM users WHERE username = 'admin' AND password = 'password';"
#text = "select * from users where username = 'admin' and password = 'password';"
#text = "SELECT * from USERS where id  =  '1' or @ @1  =  1 union select 1,version  (    )   -- 1'"
#text = "select * from data where id  =  '1'  or @"
text ="select * from users where id  =  1 or 1#\"?  =  1 or 1  =  1 -- 1"
predicted_class, confidence = predict(text)

if predicted_class > 0.7:
    print("Prediction: SQL Injection Detected")
else:
    print("Prediction: No SQL Injection Detected")
    
print(f"Confidence: {confidence:.2f}")
# OUTPUT
# Prediction: SQL Injection Detected
# Confidence: 1.00
Uses

[More Information Needed]

Direct Use

Could used in application where natural language is to be converted into SQL queries. [More Information Needed]

Out-of-Scope Use

[More Information Needed]

Bias, Risks, and Limitations

[More Information Needed]

Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.

Technical Specifications
Model Architecture and Objective

google/mobilebert-uncased

Compute Infrastructure
Hardware

one P6000 GPU

Software

Pytorch and HuggingFace

Runs of cssupport mobilebert-sql-injection-detect on huggingface.co

684
Total runs
0
24-hour runs
-29
3-day runs
-127
7-day runs
-2.3K
30-day runs

More Information About mobilebert-sql-injection-detect huggingface.co Model

More mobilebert-sql-injection-detect license Visit here:

https://choosealicense.com/licenses/apache-2.0

mobilebert-sql-injection-detect huggingface.co

mobilebert-sql-injection-detect huggingface.co is an AI model on huggingface.co that provides mobilebert-sql-injection-detect's model effect (), which can be used instantly with this cssupport mobilebert-sql-injection-detect model. huggingface.co supports a free trial of the mobilebert-sql-injection-detect model, and also provides paid use of the mobilebert-sql-injection-detect. Support call mobilebert-sql-injection-detect model through api, including Node.js, Python, http.

mobilebert-sql-injection-detect huggingface.co Url

https://huggingface.co/cssupport/mobilebert-sql-injection-detect

cssupport mobilebert-sql-injection-detect online free

mobilebert-sql-injection-detect huggingface.co is an online trial and call api platform, which integrates mobilebert-sql-injection-detect's modeling effects, including api services, and provides a free online trial of mobilebert-sql-injection-detect, you can try mobilebert-sql-injection-detect online for free by clicking the link below.

cssupport mobilebert-sql-injection-detect online free url in huggingface.co:

https://huggingface.co/cssupport/mobilebert-sql-injection-detect

mobilebert-sql-injection-detect install

mobilebert-sql-injection-detect is an open source model from GitHub that offers a free installation service, and any user can find mobilebert-sql-injection-detect on GitHub to install. At the same time, huggingface.co provides the effect of mobilebert-sql-injection-detect install, users can directly use mobilebert-sql-injection-detect installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

mobilebert-sql-injection-detect install url in huggingface.co:

https://huggingface.co/cssupport/mobilebert-sql-injection-detect

Url of mobilebert-sql-injection-detect

mobilebert-sql-injection-detect huggingface.co Url

Provider of mobilebert-sql-injection-detect huggingface.co

cssupport
ORGANIZATIONS

Other API from cssupport