Using Jiwar in Google Colab
Google Colab provides a free, cloud-based environment for running Python code. This guide will help you use Jiwar in Google Colab using the provided Jiwar_Tutorial.ipynb notebook.
Getting Started with Jiwar in Google Colab
Open the Jiwar Tutorial Notebook:
Click HERE to access the interactive Google Colab notebook for Jiwar.
Run the cells in the notebook sequentially, following the instructions provided.
Step 1: Clone Jiwar and Install Dependencies
Run the following cells to set up Jiwar in your Colab environment:
Clone the Jiwar repository:
!git clone https://github.com/AlaaAlzahrani/Jiwar.git
Install dependencies:
%cd Jiwar !pip install --upgrade pip !pip install -r requirements.txt
Install eSpeak on Google Colab:
!sudo apt-get update !sudo apt-get install -y espeak
Step 2: Run Jiwar
The notebook provides two scenarios for running Jiwar: with a built-in corpus and with a custom corpus.
Using Jiwar with a Built-in Corpus
Run the cell containing:
!python jiwar.py
When prompted:
Enter the language (e.g., “en-us” for American English)
Choose to use the built-in corpus by entering “y”
Provide the input file path (e.g., “/content/Jiwar/data/input/en_words.csv”)
Specify the measures to calculate (e.g., “all” for all measures)
Using Jiwar with a Custom Corpus
Run the same cell as above:
!python jiwar.py
When prompted:
Enter the language code
Choose not to use the built-in corpus by entering “n”
Provide the path to your custom corpus file (e.g., “/content/Jiwar/data/corpus/user_loaded/en_corpus.csv”)
Provide the input file path
Specify the measures to calculate
Tips for Using Jiwar in Colab
Input Files: Ensure your input files (word lists and custom corpora) are accessible in the Colab environment. You can upload them directly to Colab or store them in Google Drive and mount your drive.
Output: Jiwar will save the results as a CSV file. In Colab, you can download this file or save it to your Google Drive for further analysis.
Troubleshooting
If you encounter issues while using Jiwar in Google Colab:
Ensure all cells have run successfully, especially the setup and installation cells.
Check that your input files are in the correct location and format.
If you’re using a custom corpus, make sure it meets the required format specifications.
Restart the runtime if you’ve made significant changes to the environment.
If problems persist, consult the Jiwar documentation or reach out to the author for support.