Transformers: Causal Language Modeling Versus Mask Language Modeling

Introduction In this post, we will investigate the differences between Causal Language Modeling (CLM) and Masked Language Modeling (MLM) What is Causal Language Modeling? Causal Language Modeling (CLM) is a type of language modeling task where the model is trained to predict the next word in a sequence, given the previous words in the sequence; the model is trained to generate a sequence of words that makes sense in a given context....

May 10, 2023

S2AND Inference on Custom Data

Introduction In this post, we actually run the saved model we have on file on the our own custom dataset. The Code S2AND comes with a production model that has already been pretrained on their own collection of data. To run the production model on your unique datasets, simply run the code below: import pickle # reload model with open("data/production_model.pkl", "rb") as _pkl_file: clusterer = pickle.load(_pkl_file) dataset_name = 'fake' #this points to folder with generated data DATA_DIR = os....

May 2, 2023

Specter Embeddings for Author Disambiguation

Introduction The purpose of this post will be to show you how to generate Specter Embeddings specifically for the S2AND author-disambiguation algorithm. Specter embeddings are one of the most important features used in S2AND. The developers of the specter embedding models have shared their model here, freely available for anyone to use. My implementation of the code can be found in this repo. The code Without too much to waste, here’s the fully code that will generate specter embeddings for a give papers....

May 2, 2023

Huggingface Caching

Introduction Huggingface models can be quite large and require a lot of computational resources to train and run, which can be challenging for users who want to run these models on their local machines or in cloud-based environments. One solution to this problem is to use caching, which involves storing precomputed values so that they can be reused later without having to be recalculated. In the context of Hugging Face and transformer models, caching involves storing intermediate values that are generated during the processing of text data using a transformer model....

April 25, 2023
Cover

Slurm Salloc

Introduction High-Performance Computing (HPC) is an essential tool for modern scientific research, allowing scientists and researchers to perform complex calculations and simulations at an unprecedented scale. One of the most popular HPC job scheduling systems is SLURM, which stands for Simple Linux Utility for Resource Management. In this blog post, we will focus on the salloc command, one of the most commonly used SLURM commands for requesting compute resources. The Salloc command The salloc command allows users to request compute resources for interactive jobs....

April 19, 2023
Cover

S2AND Data

Introduction The purpose of this post is to evaluate the structure of the training data used in running the S2AND algorithm; understanding the file formats will help us insert our own, unique data for author disambiguation Folder Structure Here is what the full data directory looks like: As you can see, the S2AND repo provides five folders for five different test runs of the algorithm, namely: Aminer ArnetMiner Inspire Kisti Medline We also have access to the production-level, pretrained S2AND model that’s ready for us to plug in and use:...

April 18, 2023
Cover

O'Reilly: Learning PHP, MySQL & JavaScript

Sixth Edition, By Robin Nixon Chapter 1: Introduction to Dynamic Web Content HTTP is a communication standard governing the requests and responses that are sent between the browser running on the end user’s computer (client) and the web server (server). Chapter 2: Setting Up a Development Server A developer server is simply localhost testing. Chapter 3: Introduction to PHP Chapter 4: Expressions and Control Flow in PHP Chapter 5: PHP Functions and Objects Chapter 6: PHP Arrays Chapter 7: Practical PHP Chapter 8: Introduction to MySQL Chapter 9: Mastering MySQL Chapter 10: What’s New in PHP 8 and MySQL 8 Chapter 11: Accessing MySQL using PHP Chapter 12: Form Handling Chapter 13: Cookies, Sessions, and Authentication Chapter 14: Exploring JavaScript Chapter 15: Expressions and Control Flow in JavaScript Chapter 16: JavaScript Functions, Objects, and Arrays Chapter 17: JavaScript and PHP Validation and Error Handling Chapter 18: Using Asynchronous Communication Chapter 19: Introduction to CSS Chapter 20: Advance CSS with CSS3 Chapter 21: Accessing CSS from JavaScript Chapter 22: Introduction to jQuery Chapter 23: Introduction to jQuery Mobile Chapter 24: Introduction to React Chapter 25: Introduction to HTML5 Chapter 26: The HTML5 Canvas Chapter 27: HTML5 Audio and Video Chapter 28: Other HTML5 Features Chapter 29: Bringing it All Together

April 16, 2023
Entity Linking

Bert GPT

Introduction BERT (Bidirectional Encoder Representations from Transformers) and GPT (Generative Pre-trained Transformer) are both models for natural language processing (NLP) developed by Google and OpenAI respectively. The main difference between the two models lies in their approach to processing text. BERT is a bidirectional model, which means it processes text in both directions (from left to right and from right to left) to capture the context of the words. It is a transformer-based model that is pre-trained on a large corpus of text using two unsupervised learning tasks:...

April 12, 2023
Entity Linking

Entity Linking

Introduction Entity linking is a critical task in natural language processing that involves linking entities mentioned in text to their corresponding entries in a knowledge base. In this project, we implement a creative approach to entity linking that leverages the complementary capabilities of Semantic Role Labeling (SRL), Named Entity Recognition (NER), and BERT-based FAISS indexing. We use SRL and NER to extract relevant queries from the input text, which are then used to perform a search in our FAISS index....

March 30, 2023
Port Forwarding

Port Forwarding for Jupyter Notebook

Port forwarding onto a single remote server ssh into remote server run “jupyter notebook –no-browser –port=port-forwarding note: the port-forwarding can take on almost any value; 8888 is the commonly used port for jupyter port forwarding open a new shell run “ssh -L local-port:localhost:port-forwarding username@remove-server” note: local-port can take on any value and is the port we use to access localhost jupyter notebook instance. Often, many people use 8000 for jupyter notebook note: port-forwarding must match the value we specified in step 2 That’s it!...

March 28, 2023