• Apple,  Machine Learning,  Machine Learning And Artificial Intelligence,  Programming,  Swift

    New App TestFairy Writes Unit Tests With AI

    I just posted a new app to GitHub called TestFairy. It’s at https://github.com/krypted/TestFairy. It automatically generates unit tests for either a file or a highlighted piece of swift code. It does this using the OpenAI API, so leverages a LLM to write test code. It’s pretty straight forward. Simply highlight the code and in the Editor Menu, click TestFairy, then Generate Tests. I had hoped to post it for free to the App Store, but I didn’t want to distribute my OpenAI API key, or write an intermediary microservice that housed my key that an app uses. The use of an API key is considered an end-around to the In-App…

  • Machine Learning And Artificial Intelligence

    Regulation And Coexistence With AI

    I’ve been writing little machine learning and AI bits of code for a pretty long time and while I’m not very good at it, I feel like the one thing I’ve learned is not to look for what I want to see. “Lying with statistics” was one of the most impactful courses I took in college. The confirmation bias in my works before and after we’re substantially different. Turns out you can look at fatalities from driverless cars or put them in perspective when compared to fatalities for the same number of hours driven by humans. Or focus on the mean vs the average. The perspective a quant has shapes…

  • Machine Learning,  Machine Learning And Artificial Intelligence,  Programming

    Detect Deepfakes and Hacked Audio Programmatically

    Deepfakes are a type of synthetic media where a person replaces parts of an image or video with something else, like someone’s likeness. The act of creating deepfakes is known as deepfakery. Deepfakes can be used to create fake news, spread misinformation, or damage someone’s reputation. They can also be used by a service like JibJab just to be funny, although those are obviously cartoonish and not meant to actually fool anyone. There are a number of different approaches to detecting deepfakes. Some of these approaches are based on image forensics, which is the study of digital images to identify and extract hidden information. Other approaches are based on machine…

  • Apple,  Machine Learning,  Machine Learning And Artificial Intelligence,  Programming,  Python

    Detecting LLM-Generated Code

    Large language models (LLMs) are a type of artificial intelligence that generates text, translates languages, writes different kinds of creative content, creates net-new artistic works, and answers questions in an informative way. They are trained on massive datasets of text and code, and can learn to produce human-quality output. Because of how they import massive troves of data and create similar content, they can then be fairly formulaic in their output.  A few things to look for to help determine if code was written by an LLM: If you are suspicious that a piece of code was written by an LLM, you can use a number of tools to help…

  • Machine Learning,  Machine Learning And Artificial Intelligence,  Programming

    Detecting AI-Generated (LLM) Content In Articles

    We hear more and more about the pros and cons of AI. There is a movement to regulate the use, movies about dangers of sentient robots, and those who think AI will free humanity from any boring work, or work that involves a lot of repetitive tasks. Going back to the 1950s and 1960s, what they called AI (or what we might call small shell scripts these days) were supposed to “Augment Human Intellect” as the great Doug Englebart wrote about in his 1962 article https://www.dougengelbart.org/content/view/138 or Vannevar Bush’s “As We May Think” from 1945, available at https://www.theatlantic.com/magazine/archive/1945/07/as-we-may-think/303881/. What is an LLM? A large language model (LLM) is a type…

  • Machine Learning And Artificial Intelligence

    Generic Machine Learning Recommender Script

    Been working more on building really generic and simple machine learning tools. This one is a generic recommendation script built to run as a lambda or gcf. This iteration on my GitHub is built to run locally but it’s straight forward enough to import json, parse, and run it as a microservice. Requirements numpy gensim nltk==3.4.5 textblob==0.15.3 Usage Run locally, the recommender crawls through a column of a csv and matches the recommendations for similar content. Those are based on the content passed in the –text field. Can use the –recs option to define the number of recs you’d like to recieve in response. python recommender.py --file='my.csv' --text="Flash update" --column="title"…

  • Java,  Machine Learning,  Machine Learning And Artificial Intelligence,  Uncategorized

    12+ Machine Learning Libraries For Java Projects

    It seems like a lot of people are using micro services that are hosted by a third party vendor to process various bits of natural language processing and other tasks that typically get lumped into the “Machine Learning” bucket. But there are a lot of environments that need self-contained systems. Especially when it’s simple to build a small project to do a task using something like Python’s nltk, but when you start hammering those microservices you build with those tools you start to feel how their ease-of-use can make them a bit more sluggish than purpose-built tooling (I guess that’s true for everything in software development). So let’s look at…

  • Machine Learning And Artificial Intelligence,  Python

    Lightweight Python Tagger Using NLTK

    Recently I was looking at automating the tagging of content from a mysql database. NLTK (Natural Language Training Kit) to the rescue to make this pretty easy. This GitHub project wraps NLTK into a small script to tag and provides a class for excluding words: Once the tagger was written we could add cursor.execute() or cursor.fetchall() as a way to bring in input from mysql content or since it’s a one-time run, we can use a simple mysql query run from bash and dump the output into the script as follows: mysql -X -u $supersecretUSER -p$supersecretPASS -h$HostName -D$MyDB -e'SELECT notes FROM tablename > notes.json lightweighttagger.py In the above just swap…

  • Machine Learning And Artificial Intelligence

    10 Laws of Support Chatbots

    I really enjoy chatbots. They can be way more pleasant to work with than some some service desks out there who are after cheaper rather than better support options for customers. And rarely do we see a service desk that isn’t growing at a slower rate than customer growth, so in most cases they’re fast to get to and easier to train that actual humanness. But some chatbots are amazing and others can be terrible. So let’s look at Asimov’s, er I mean, my laws of chatbots: Chatbots should be connected to an extensive list of content to analyze and make recommendations so they can meaningfully answer questions. Chatbots should…