DIY AI Part 3: Setting up your environment and installing libraries

Anadolu/GettyImages
facebooktwitterreddit

If you have been following the first parts of this series and have the computer power, we can continue with our AI project. In this part, we’ll talk about setting up your environment and installing the libraries we’ll need to get ready for the next steps. This part is fast and easy but essential, with a lot of useful information.

Installing Visual Studio Code and setting up a virtual environment

For this project, we are going to use the Visual Studio Code (VS Code) editor, which you can get for free from their website. It’s powerful, lightweight, fully featured, and works well with Python, which is the programming language we are going to use.

If you need help installing Visual Studio Code, we have a guide.

Once you have VS Code running, create a project folder with the name of your DIY AI (My_DIY_AI). Then, set up your virtual environment.

If you need help setting up your virtual environment, we have a guide.

Installing the libraries

Once you have your virtual environment going, it will be time to start installing the libraries we will need for our project.

os and shutil

os and shutil are pre-installed in Python, so we won’t need to install them, but since we will be using them for file and directory management as well as copying, moving, and removing files and directories.

Pandas

Pandas is great for handling large data sets, supports a variety of data formats, and integrates seamlessly with other Python libraries.

PyPDF2, fitz

PyPDF2, fitz are libraries for reading and writing PDF files

python-magic

python-magic will help detect file types by examining their contents and not just the file extension, which helps ensure accurate identification regardless of naming conventions.

Whoosh

Whoosh is ideal for creating and managing search functionality within local or embedded applications. It allows you to index files and retrieve content efficiently.

Transformers and Torch

Transformers and Torch are libraries that power natural language processing tasks, such as summarization, sentiment analysis, and text classification. Transformers contains pre-trained models for tasks like question answering, text generation, and summarization. Torch is a machine learning framework widely used for deep learning, supporting the training of custom NLP models.

Top modern programming languages driving the future of development

Numpy and Scipy

Numpy and Scipy are mathematical libraries that are important for performing calculations and preprocessing in any data science or machine learning project. They are responsible for handling arrays, matrices, and large datasets.

FastAPI and Uvicorn

FastAPI and Uvicorn are for building fast, lightweight APIs to serve data or machine learning models offline.

To install these libraries, use the following command in the terminal while inside your virtual environment. With the libraries installed, the backbone of our AI project is in place. In the next guide, we’ll create the file structure and get close to giving it a try.

Follow GeekSided for more great DIY projects.

feed