ARB Security Solutions, LLC.

Classify, Upload to a SPO, Scan With Vulnerability Management API

First use PyTorch to classify an image using a pre-trained ResNet model then upload the classified image to a SharePoint Online document library using the SharePoint ClientContext API. Retrieve the current vulnerability count using the Vulnerability Management API by making an HTTP request to the appropriate endpoint. import torchfrom torchvision import transformsfrom office365.sharepoint.client_context import ClientContextimport […]

Pytorch Sentiment Analysis For Phishing Analysis Fun!

This script performs sentiment analysis on the email contents using the sentiment analysis model and applies a pre-trained phishing detection model to identify potential phishing emails. After connecting to Exchange Online and retrieving the emails, the Python code loads the sentiment analysis model and the phishing detection model. It then processes each email’s contents, performs […]

Exchange Online and PyTorch To Perform Sentiment Analysis On Bodies and Recommendations

Whole lotta assumptions here but whatever. After retrieving the email bodies using Exchange Online, the Python code loads the sentiment analysis model and the email response recommendation model. It then processes the email bodies and generates response recommendations using the GPT-2 model. The sentiment analysis results and the response recommendations are printed for each email […]

PyTorch To Perform Sentiment Analysis On Exchange Online Subject Lines

First establish a connection to Exchange Online using the Connect-ExchangeOnline cmdlet. We then retrieve a list of email subject lines using the Get-EXOMailboxMessage cmdlet. Next, we define the Python code that performs sentiment analysis using PyTorch and the Transformers library. The email subject lines are passed to the sentiment analysis model, and the results are […]

PyTorch Training Loss Threshold Breach Posting Alerts To Microsoft Teams

This script trains a model using the CIFAR10 dataset. During each epoch, it calculates the average training loss and checks if it exceeds a predefined threshold. If the threshold is exceeded, an alert is sent to a Microsoft Teams channel using a Microsoft Teams card created with the pymsteams library. import torch import torch.nn as […]

PyTorch and Microsoft Teams API To Send Notifications

This script trains a model using the CIFAR10 dataset. During each epoch, it calculates the training loss and accuracy. It then sends a progress update message to a Microsoft Teams channel using a Microsoft Teams card created with the pymsteams library. import torch import torch.nn as nn import torch.optim as optim from torchvision import datasets, […]

Post Model Training To Microsoft Teams Channel Using PyTorch

Well hello there Imports. This script performs the training loop for the defined number of epochs. It trains the model on the CIFAR10 dataset and calculates the training and testing accuracy at each epoch. It also sends a progress update message to a Microsoft Teams channel using a Microsoft Teams card created with the pymsteams […]

Transfer Learning, TensorBoardX, And SharePoint Online

Import dat torch yo! This script configures the data transformations for the custom dataset using data_transforms. It defines the ResNet-50 model for transfer learning and replaces the final fully connected layer with a new one suitable for the custom classification task. The script specifies hyperparameters such as the number of classes, number of epochs, batch […]

Multiple GPU Checkpoint Pre SPO Upload

Import Dat Torch! import osimport torchimport torch.nn as nnimport torch.optim as optimfrom torchvision import transformsfrom torch.utils.data import DataLoaderfrom shareplum import Sitefrom shareplum import Office365 # SharePoint Online credentials and site informationusername = ‘your_username’password = ‘your_password’site_url = ‘https://your_sharepoint_site_url’document_library = ‘Documents’ # Custom datasetclass CustomDataset(torch.utils.data.Dataset): def __init__(self, data_dir): self.data = […] # Your custom data loading logic […]

Hyperparameter Tuning, Upload To SharePoint Online

Define a hyperparameter grid for the GridSearchCV algorithm, which performs hyperparameter tuning. The train_model() function is used to train the model with the best hyperparameters obtained from GridSearchCV. We then evaluate the trained model using the evaluate_model() function. The best model is saved to a file using the save_model() function. We also save the evaluation […]