Skip to content

البدء السريع

ابدأ العمل مع Potato في أقل من 5 دقائق.

البدء السريع

ابدأ تشغيل Potato في خطوات قليلة فقط. سيساعدك هذا الدليل على بدء التوسيم في أقل من 5 دقائق.

المتطلبات الأساسية

  • Python 3.7 أو أعلى
  • مدير الحزم pip

التثبيت

قم بتثبيت Potato باستخدام pip:

bash
pip install potato-annotation

إنشاء مشروعك الأول

1. إنشاء مجلد المشروع

bash
mkdir my-annotation-task
cd my-annotation-task

2. إنشاء ملف البيانات

أنشئ مجلد data وأضف ملفًا باسم data.json يحتوي على البيانات المراد توسيمها:

bash
mkdir data
json
[
  {"id": "1", "text": "I love this product! It's amazing."},
  {"id": "2", "text": "This is the worst experience ever."},
  {"id": "3", "text": "It's okay, nothing special."}
]

3. إنشاء ملف الإعدادات

أنشئ ملفًا باسم config.yaml في مجلد مشروعك:

مهم: يجب أن يكون ملف الإعدادات موجودًا داخل مجلد المشروع. هذا متطلب أمني في Potato 2.0.

yaml
port: 8000
server_name: localhost
task_name: "Sentiment Analysis"
 
# Task directory (current directory)
task_dir: "."
 
# Data configuration
data_files:
  - "data/data.json"
 
item_properties:
  id_key: id
  text_key: text
 
# Output configuration
output_annotation_dir: "output/"
output_annotation_format: "json"
 
# Annotation scheme
annotation_schemes:
  - annotation_type: radio
    name: sentiment
    description: "What is the sentiment of this text?"
    labels:
      - Positive
      - Negative
      - Neutral
 
# Allow anyone to annotate
allow_all_users: true

4. بدء تشغيل الخادم

bash
python -m potato start config.yaml -p 8000

أو باستخدام الاختصار:

bash
potato start config.yaml

5. افتح المتصفح

انتقل إلى http://localhost:8000 وابدأ التوسيم!

هيكل المشروع

يجب أن يبدو مشروعك كالتالي:

text
my-annotation-task/
├── config.yaml
├── data/
│   └── data.json
└── output/          # Created automatically
    └── annotations.json

ما التالي؟

الأدوات والمرافق

بعد أن تتقن الأساسيات، تحقق من هذه الأدوات المفيدة: