Skip to content

josephmcnitt/Chess-App

Repository files navigation

Chess Analysis App This is a Python application that analyzes chess games and provides insights into the players' moves. It uses the python-chess library to read Portable Game Notation (PGN) files and extract positions and moves, and a machine learning model based on BERT to give commentary on moves.

#Setup To use this application, you will need to install the required Python packages:

##Copy code pip install python-chess transformers torch You will also need to download a pre-trained BERT model from the Hugging Face model hub. You can use the following command to download the bert-base-uncased model:

bash ##Copy code mkdir models cd models wget https://huggingface.co/bert-base-uncased/resolve/main/pytorch_model.bin wget https://huggingface.co/bert-base-uncased/resolve/main/config.json You can also download other models from the Hugging Face model hub.

##Usage To run the application, use the following command:

##lua Copy code python analyze.py input.pgn output.txt where input.pgn is the input PGN file containing one or more games, and output.txt is the output file containing the FEN positions and move classifications.

The output file will contain one line for each move in the input file, in the following format:

##php Copy code FEN: ; Move: ; Classification: where is the FEN position after the move, is the move in algebraic notation, and is the classification of the move.

##License This project is licensed under the MIT License - see the LICENSE.md file for details.

##Acknowledgments This project was inspired by the chess-analysis project by Jonathan Laurent.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages