{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "62188aef", "metadata": {}, "outputs": [], "source": [ "list_complete = ''\n", "list_pending = ''\n", "title = ''\n", "perc = ('80', '40', '۸۰٪')\n", "description = ''\n", "comment = ''\n", "link = ''\n", "link_ref = ''\n", "\n", "def get_html(list_complete, list_pending, title, perc, description, comment, link, link_ref):\n", "\n", " completed_tasks = ''\n", " for i in list_complete:\n", " completed_tasks += '
  • ' + i +'
  • '\n", "\n", " pending_task = ''\n", " for i in list_pending:\n", " pending_task += '
  • ' + i +'
  • '\n", "\n", "\n", "\n", " html_1 = \"\"\"\n", "
    \n", "
    \n", "
    \n", "
    \"\"\"+ title + '

    '\n", "\n", " html_1 += description\n", " html_1 += '

    وضعیت پیشرفت '\n", " html_1 += '
    ' +perc[2]\n", " html_1 += '

    '\n", "\n", " if len(completed_tasks)>0:\n", " html_1 +='

      ' + completed_tasks + '
    '\n", "\n", " if len(pending_task)>0:\n", " html_1 +='
      ' + pending_task + '
    '\n", " html_1 += '

    '\n", " if type(comment)==str:\n", " html_1 += str(comment)\n", "\n", " if type(link)==str:\n", " html_1 += ''\n", " if type(link_ref)==str:\n", " html_1 += '

    ' + str(link_ref) + '

    '\n", " else:\n", " html_1 += '

    آدرس

    '\n", " html_1 += '
    '\n", "\n", " html_1 += \"\"\"
    \n", " \"\"\"\n", " return html_1" ] }, { "cell_type": "code", "execution_count": 6, "id": "ccb7eed8", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "#csv_file_path = 'proj_data_ex.xlsx'\n", "#csv_file_path = 'distributed_ai.xlsx'\n", "#csv_file_path = 'questionner.xlsx'\n", "csv_file_path = 'fairness.xlsx'\n", "\n", "xls = pd.read_excel(csv_file_path, sheet_name=None, engine='openpyxl')\n", "\n" ] }, { "cell_type": "code", "execution_count": 7, "id": "762b688a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "
    \n", "
    \n", "
    \n", "
    انصاف در اثرگذاری

    روش متفاوتی ربای معیار سنجی انصاف مدل بر اساس میزان تاثیر کلی هر داده (یا گروه داده) بر روی تصمیمات مدل.

    وضعیت پیشرفت
    ۴۰٪

    • تخمین سهم تاثیر داده‌ها
    • محاسبه تاثیر کناری برای دسته‌های مختلف داده
    • دسته‌بندی روش‌های متفاوت برای نسبت سنجی تاثیر
    • مقایسه‌ی شرایط منصفانه و غیر منصفانه
    • مقایسه‌ی کیفی شرایط تشخیص با روش‌های کنونی
    • اعمال شرط انصاف در آموزش مدل

    \n", " \n" ] } ], "source": [ "percentages = [('10', '2', '۰٪'),\n", " ('15', '5', '۱۰٪'),\n", " ('20', '10', '۲۰٪'),\n", " ('30', '15', '۳۰٪'),\n", " ('40', '20', '۴۰٪'),\n", " ('50', '25', '۵۰٪'),\n", " ('60', '30', '۶۰٪'),\n", " ('70', '35', '۸۰٪'),\n", " ('80', '40', '۸۰٪'),\n", " ('90', '45', '۹۰٪'),\n", " ('100', '50', '۱۰۰٪')]\n", "for sheet_name, df in xls.items():\n", " cols = df.columns\n", " title = df[df.columns[0]][0]\n", " description = df[df.columns[1]][0]\n", " p = int(df[df.columns[2]][0])\n", " perc = percentages[p]\n", " list_complete = df[df.columns[3]].dropna()\n", " list_pending = df[df.columns[4]].dropna()\n", " comment = df[df.columns[5]].dropna()\n", " link = df[df.columns[6]][0]\n", " link_ref = df[df.columns[7]][0]\n", "\n", " h = get_html(list_complete, list_pending, title, perc, description, comment, link, link_ref)\n", " print(h)\n", "\n", " " ] }, { "cell_type": "code", "execution_count": 161, "id": "91b185fb", "metadata": {}, "outputs": [ { "ename": "TypeError", "evalue": "object of type 'numpy.float64' has no len()", "output_type": "error", "traceback": [ "\u001b[1;31m\u001b[0m", "\u001b[1;31mTypeError\u001b[0mTraceback (most recent call last)", "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_37900/3929354373.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlink\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mTypeError\u001b[0m: object of type 'numpy.float64' has no len()" ] } ], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }