cdcvd commited on
Commit
78a941d
·
verified ·
1 Parent(s): 4c30a39

Upload 2 files

Browse files
chat_gpt_promote (1).ipynb ADDED
@@ -0,0 +1,736 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": []
7
+ },
8
+ "kernelspec": {
9
+ "name": "python3",
10
+ "display_name": "Python 3"
11
+ },
12
+ "language_info": {
13
+ "name": "python"
14
+ }
15
+ },
16
+ "cells": [
17
+ {
18
+ "cell_type": "code",
19
+ "execution_count": null,
20
+ "metadata": {
21
+ "colab": {
22
+ "base_uri": "https://localhost:8080/"
23
+ },
24
+ "id": "dSJG6OEazaWm",
25
+ "outputId": "300bae8f-42ee-48d0-83ba-80ed9b31e92f"
26
+ },
27
+ "outputs": [
28
+ {
29
+ "output_type": "stream",
30
+ "name": "stdout",
31
+ "text": [
32
+ "رزومه حرفه‌ای و منظم شما به شرح زیر است:\n",
33
+ "\n",
34
+ "---\n",
35
+ "\n",
36
+ "### مشخصات شخصی:\n",
37
+ "- **نام:** مریم نوری\n",
38
+ "- **وضعیت تاهل:** مجرد\n",
39
+ "- **سن:** 38 سال\n",
40
+ "- **جنسیت:** خانم\n",
41
+ "- **محل اقامت:** تهران\n",
42
+ "\n",
43
+ "### تحصیلات:\n",
44
+ "- **مدرک تحصیلی:** لیسانس و زبان انگلیسی\n",
45
+ "- **رشته تحصیلی:** مهندسی نرم افزار\n",
46
+ "\n",
47
+ "### تجربیات کاری:\n",
48
+ "1. **برنامه‌نویس و متخصص هوش مصنوعی**\n",
49
+ " - اشتغال آزاد\n",
50
+ " - سابقه کار از سال 1393 تا کنون\n",
51
+ " - تخصص در توسعه برنامه‌های وب و موبایل\n",
52
+ " - تجربه کار با زبان‌های برنامه‌نویسی Python، C#، C و Delphi\n",
53
+ " - آشنایی با Net Core، Microsoft One Note، Microsoft Access و Microsoft Powerpoint\n",
54
+ "\n",
55
+ "### تحصیلات تکمیلی:\n",
56
+ "- **مدرک دوره‌های آموزشی:**\n",
57
+ " - توسعه نرم‌افزارهای هوش مصنوعی\n",
58
+ " - توسعه نرم‌افزارهای تحت وب\n",
59
+ " - توسعه نرم‌افزارهای موبایل\n",
60
+ "\n",
61
+ "### اطلاعات تماس:\n",
62
+ "- **تلفن:** 09132177559\n",
63
+ "- **ایمیل:** [email protected]\n",
64
+ "- **پیوند GitHub:** [GitHub Profile](https://github.com/MaryamNour\n"
65
+ ]
66
+ }
67
+ ],
68
+ "source": [
69
+ "#!pip install openai==0.28\n",
70
+ "import openai\n",
71
+ "\n",
72
+ "# کلید API خود را وارد کنید (مطمئن شوید که این کلید را مخفی نگه دارید)\n",
73
+ "openai.api_key = 'sk-proj-bC6H6QrP6DUqHkn5vOkYT3BlbkFJsSyvL4Bc9c3UEbHrsPMj'\n",
74
+ "\n",
75
+ "def create_optimized_resume(info):\n",
76
+ " prompt = f\"\"\"\n",
77
+ " من اطلاعات زیر را به شما می‌دهم، لطفاً یک رزومه حرفه‌ای و منظم برای من ایجاد کنید.\n",
78
+ " اطلاعات:\n",
79
+ " {info}\n",
80
+ "\n",
81
+ " رزومه حرفه‌ای و منظم:\n",
82
+ " \"\"\"\n",
83
+ "\n",
84
+ " response = openai.ChatCompletion.create(\n",
85
+ " model=\"gpt-3.5-turbo\",\n",
86
+ " messages=[\n",
87
+ " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
88
+ " {\"role\": \"user\", \"content\": prompt}\n",
89
+ " ],\n",
90
+ " max_tokens=500,\n",
91
+ " n=1,\n",
92
+ " stop=None,\n",
93
+ " temperature=0.5,\n",
94
+ " )\n",
95
+ "\n",
96
+ " return response.choices[0].message['content'].strip()\n",
97
+ "\n",
98
+ "# اطلاعات ورودی رزومه\n",
99
+ "info = \"\"\"ﻧﻮری ﻣﺮﯾﻢ\n",
100
+ "ﺳ\u0002ﺎﻫﺎن ﺗﻮاﺗﺮ ﻣﻬﻨﺪﺳﯽ ﺷﺮﮐﺖ در ﻧﻮﯾﺲ\n",
101
+ "برنامه\n",
102
+ "رﺑﺎﺗﯿﮏ و ﻣﺼﻨﻮﻋﯽ ﻫﻮش ارﺷﺪ ﮐﺎرﺷﻨﺎﺳﯽ\n",
103
+ "اﺳﻼﻣﯽ آزاد داﻧﺸﮕﺎه\n",
104
+ "ﻓﺮدی ﻣﺸﺨﺼﺎت\n",
105
+ "ﺳﺎل 38\n",
106
+ ":ﺳﻦ\n",
107
+ "زن:ﺟﻨﺴﯿﺖ\n",
108
+ "ﻣﺠﺮد:ﺗﺎﻫﻞ وﺿﻌﯿﺖ\n",
109
+ "ﺗﻤﺎس اﻃﻼﻋﺎت\n",
110
+ "-\n",
111
+ "-\n",
112
+ "-\n",
113
+ "-\n",
114
+ "-\n",
115
+ ":ﺗﻠﻔﻦ\n",
116
+ "09132177559\n",
117
+ ":ﻣﻮﺑﺎ;ﻞ\n",
118
119
+ ":اﯾﻤﯿﻞ\n",
120
+ "اﻟﺪوﻟﻪ ﺣﺸﻤﺖ\n",
121
+ "-\n",
122
+ " ﺟﻤﺎﻟﺰاده\n",
123
+ "-\n",
124
+ " ﺗﻬﺮان\n",
125
+ ":ﺳﮑﻮﻧﺖ ﻣﺤﻞ\n",
126
+ ":ﻟﯿﻨﮑﺪ;ﻦ\n",
127
+ "-\n",
128
+ "ﮐﺎری ﺳﺎﺑﻘﻪ و ﺣﻘﻮق\n",
129
+ "ﺳﺎل 11\n",
130
+ ":ﮐﺎری ﺳﺎﺑﻘﻪ ﻣﯿﺰان\n",
131
+ "ﺗﻮﻣﺎن ﻣﯿﻠﯿﻮن 15\n",
132
+ "-\n",
133
+ " 20\n",
134
+ ":ﺣﻘﻮق\n",
135
+ "ﮐﺎر ﻧﻤﻮﻧﻪ\n",
136
+ " https://github.com/MaryamNourii?tab=repos…\n",
137
+ "www.jobvision.ir\n",
138
+ ":رزوﻣﻪ رﺳﺎﻧﯽ\n",
139
+ "\u0018ﺮوز1402 دی 20\n",
140
+ ":ﮐﺎر\u0018ﺮی ﺷﻨﺎﺳﻪJV-16905476\n",
141
+ "ﺷﻐﻠﯽ ﺳﻮاﺑﻖ\n",
142
+ "ﺗﺤﺼﯿﻠﯽ ﺳﻮاﺑﻖ\n",
143
+ "ﺧﺎرﺟﯽ ﻫﺎی\n",
144
+ "زﺑﺎن\n",
145
+ "اﻓﺰارﻫﺎ ﻧﺮم\n",
146
+ "(ﻣﺎه 9 و ﺳﺎل 10) 1398 ﺧﺮداد ﺗﺎ 1387 ﺷﻬﺮ;ﻮر\n",
147
+ "ﻧﻮﯾﺲ\n",
148
+ "Dﺮﻧﺎﻣﻪ\n",
149
+ "ﺳ\u0002ﺎﻫﺎن ﺗﻮاﺗﺮ ﻣﻬﻨﺪﺳﯽ ﺷﺮﮐﺖ\n",
150
+ "ﺗﻬﺮان ا;ﺮان\n",
151
+ "1393 - 1396رﺑﺎﺗﯿﮏ و ﻣﺼﻨﻮﻋﯽ ﻫﻮش\n",
152
+ "-\n",
153
+ " ارﺷﺪ ﮐﺎرﺷﻨﺎﺳﯽ\n",
154
+ "اﺳﻼﻣﯽ آزاد داﻧﺸﮕﺎه\n",
155
+ "1383 - 1387ﮐﺎﻣﭙﯿﻮﺗﺮ ﻣﻬﻨﺪﺳﯽ\n",
156
+ "-\n",
157
+ " ﮐﺎرﺷﻨﺎﺳﯽ\n",
158
+ "اﺳﻼﻣﯽ آزاد داﻧﺸﮕﺎه\n",
159
+ "٪۵۰ ﻣﺘﻮﺳﻂ | اﻧﮕﻠﯿﺴﯽ\n",
160
+ "ﻣﻘﺪﻣﺎﺗﯽ | Microsoft One Note ﻣﻘﺪﻣﺎﺗﯽ | Microsoft Access ﻣﻘﺪﻣﺎﺗﯽ | Delphi\n",
161
+ "ﻣﺘﻮﺳﻂ | Net Core / .Net. ﻣﺘﻮﺳﻂ | +\n",
162
+ "+ C ﻣﺘﻮﺳﻂ | C ﻣﺘﻮﺳﻂ | Microsoft Powerpoint\n",
163
+ "gﯿﺸﺮﻓﺘﻪ | #C\n",
164
+ "gﯿﺸﺮﻓﺘﻪ | Python ﻣﺘﻮﺳﻂ | OpenCV ﻣﺘﻮﺳﻂ | Keras\n",
165
+ "gﯿﺸﺮﻓﺘﻪ | Microsoft Visual Studio\n",
166
+ "\n",
167
+ "\"\"\"\n",
168
+ "\n",
169
+ "# ایجاد رزومه بهینه\n",
170
+ "optimized_resume = create_optimized_resume(info)\n",
171
+ "print(optimized_resume)"
172
+ ]
173
+ },
174
+ {
175
+ "cell_type": "code",
176
+ "source": [
177
+ "#!pip install openai==0.28\n",
178
+ "import openai\n",
179
+ "\n",
180
+ "# کلید API خود را وارد کنید (مطمئن شوید که این کلید را مخفی نگه دارید)\n",
181
+ "openai.api_key = 'sk-proj-bC6H6QrP6DUqHkn5vOkYT3BlbkFJsSyvL4Bc9c3UEbHrsPMj'\n",
182
+ "\n",
183
+ "def create_optimized_resume(info):\n",
184
+ " prompt = f\"\"\"\n",
185
+ " من اطلاعات زیر را به شما می‌دهم، لطفاً یک رزومه حرفه‌ای و منظم برای من ایجاد کنید.\n",
186
+ " اطلاعات:\n",
187
+ " {info}\n",
188
+ "\n",
189
+ " رزومه حرفه‌ای و منظم:\n",
190
+ " \"\"\"\n",
191
+ "\n",
192
+ " response = openai.ChatCompletion.create(\n",
193
+ " model=\"gpt-3.5-turbo\",\n",
194
+ " messages=[\n",
195
+ " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
196
+ " {\"role\": \"user\", \"content\": prompt}\n",
197
+ " ],\n",
198
+ " max_tokens=500,\n",
199
+ " n=1,\n",
200
+ " stop=None,\n",
201
+ " temperature=0.5,\n",
202
+ " )\n",
203
+ "\n",
204
+ " return response.choices[0].message['content'].strip()\n",
205
+ "\n",
206
+ "# اطلاعات ورودی رزومه\n",
207
+ "info = \"\"\"ﻧﻮری ﻣﺮﯾﻢ\n",
208
+ "ﺳ\u0002ﺎﻫﺎن ﺗﻮاﺗﺮ ﻣﻬﻨﺪﺳﯽ ﺷﺮﮐﺖ در ﻧﻮﯾﺲ\n",
209
+ "برنامه\n",
210
+ "رﺑﺎﺗﯿﮏ و ﻣﺼﻨﻮﻋﯽ ﻫﻮش ارﺷﺪ ﮐﺎرﺷﻨﺎﺳﯽ\n",
211
+ "اﺳﻼﻣﯽ آزاد داﻧﺸﮕﺎه\n",
212
+ "ﻓﺮدی ﻣﺸﺨﺼﺎت\n",
213
+ "ﺳﺎل 38\n",
214
+ ":ﺳﻦ\n",
215
+ "زن:ﺟﻨﺴﯿﺖ\n",
216
+ "ﻣﺠﺮد:ﺗﺎﻫﻞ وﺿﻌﯿﺖ\n",
217
+ "ﺗﻤﺎس اﻃﻼﻋﺎت\n",
218
+ "-\n",
219
+ "-\n",
220
+ "-\n",
221
+ "-\n",
222
+ "-\n",
223
+ ":ﺗﻠﻔﻦ\n",
224
+ "09132177559\n",
225
+ ":ﻣﻮﺑﺎ;ﻞ\n",
226
227
+ ":اﯾﻤﯿﻞ\n",
228
+ "اﻟﺪوﻟﻪ ﺣﺸﻤﺖ\n",
229
+ "-\n",
230
+ " ﺟﻤﺎﻟﺰاده\n",
231
+ "-\n",
232
+ " ﺗﻬﺮان\n",
233
+ ":ﺳﮑﻮﻧﺖ ﻣﺤﻞ\n",
234
+ ":ﻟﯿﻨﮑﺪ;ﻦ\n",
235
+ "-\n",
236
+ "ﮐﺎری ﺳﺎﺑﻘﻪ و ﺣﻘﻮق\n",
237
+ "ﺳﺎل 11\n",
238
+ ":ﮐﺎری ﺳﺎﺑﻘﻪ ﻣﯿﺰان\n",
239
+ "ﺗﻮﻣﺎن ﻣﯿﻠﯿﻮن 15\n",
240
+ "-\n",
241
+ " 20\n",
242
+ ":ﺣﻘﻮق\n",
243
+ "ﮐﺎر ﻧﻤﻮﻧﻪ\n",
244
+ " https://github.com/MaryamNourii?tab=repos…\n",
245
+ "www.jobvision.ir\n",
246
+ ":رزوﻣﻪ رﺳﺎﻧﯽ\n",
247
+ "\u0018ﺮوز1402 دی 20\n",
248
+ ":ﮐﺎر\u0018ﺮی ﺷﻨﺎﺳﻪJV-16905476\n",
249
+ "ﺷﻐﻠﯽ ﺳﻮاﺑﻖ\n",
250
+ "ﺗﺤﺼﯿﻠﯽ ﺳﻮاﺑﻖ\n",
251
+ "ﺧﺎرﺟ��� ﻫﺎی\n",
252
+ "زﺑﺎن\n",
253
+ "اﻓﺰارﻫﺎ ﻧﺮم\n",
254
+ "(ﻣﺎه 9 و ﺳﺎل 10) 1398 ﺧﺮداد ﺗﺎ 1387 ﺷﻬﺮ;ﻮر\n",
255
+ "ﻧﻮﯾﺲ\n",
256
+ "Dﺮﻧﺎﻣﻪ\n",
257
+ "ﺳ\u0002ﺎﻫﺎن ﺗﻮاﺗﺮ ﻣﻬﻨﺪﺳﯽ ﺷﺮﮐﺖ\n",
258
+ "ﺗﻬﺮان ا;ﺮان\n",
259
+ "1393 - 1396رﺑﺎﺗﯿﮏ و ﻣﺼﻨﻮﻋﯽ ﻫﻮش\n",
260
+ "-\n",
261
+ " ارﺷﺪ ﮐﺎرﺷﻨﺎﺳﯽ\n",
262
+ "اﺳﻼﻣﯽ آزاد داﻧﺸﮕﺎه\n",
263
+ "1383 - 1387ﮐﺎﻣﭙﯿﻮﺗﺮ ﻣﻬﻨﺪﺳﯽ\n",
264
+ "-\n",
265
+ " ﮐﺎرﺷﻨﺎﺳﯽ\n",
266
+ "اﺳﻼﻣﯽ آزاد داﻧﺸﮕﺎه\n",
267
+ "٪۵۰ ﻣﺘﻮﺳﻂ | اﻧﮕﻠﯿﺴﯽ\n",
268
+ "ﻣﻘﺪﻣﺎﺗﯽ | Microsoft One Note ﻣﻘﺪﻣﺎﺗﯽ | Microsoft Access ﻣﻘﺪﻣﺎﺗﯽ | Delphi\n",
269
+ "ﻣﺘﻮﺳﻂ | Net Core / .Net. ﻣﺘﻮﺳﻂ | +\n",
270
+ "+ C ﻣﺘﻮﺳﻂ | C ﻣﺘﻮﺳﻂ | Microsoft Powerpoint\n",
271
+ "gﯿﺸﺮﻓﺘﻪ | #C\n",
272
+ "gﯿﺸﺮﻓﺘﻪ | Python ﻣﺘﻮﺳﻂ | OpenCV ﻣﺘﻮﺳﻂ | Keras\n",
273
+ "gﯿﺸﺮﻓﺘﻪ | Microsoft Visual Studio\n",
274
+ "\n",
275
+ "\"\"\"\n",
276
+ "\n",
277
+ "# ایجاد رزومه بهینه\n",
278
+ "optimized_resume = create_optimized_resume(info)\n",
279
+ "print(optimized_resume)"
280
+ ],
281
+ "metadata": {
282
+ "colab": {
283
+ "base_uri": "https://localhost:8080/"
284
+ },
285
+ "id": "ba9_tGedzezw",
286
+ "outputId": "e3509291-65b0-48dd-e6ab-81727739b18b"
287
+ },
288
+ "execution_count": null,
289
+ "outputs": [
290
+ {
291
+ "output_type": "stream",
292
+ "name": "stdout",
293
+ "text": [
294
+ "رزومه حرفه‌ای شما به شرح زیر است:\n",
295
+ "\n",
296
+ "نام: مریم نوری\n",
297
+ "تاریخ تولد: ۳۸ سال\n",
298
+ "جنسیت: خانم\n",
299
+ "وضعیت تاهل: مجرد\n",
300
+ "آدرس: تهران\n",
301
+ "\n",
302
+ "تحصیلات:\n",
303
+ "- دیپلم رشته تجربی\n",
304
+ "- فوق دیپلم برنامه نویسی و مهندسی نرم افزار\n",
305
+ "\n",
306
+ "تجربه‌های کاری:\n",
307
+ "- برنامه نویس و متخصص هوش مصنوعی، ۵ سال\n",
308
+ "- توسعه دهنده نرم افزار، ۳ سال\n",
309
+ "\n",
310
+ "مهارت‌ها:\n",
311
+ "- آشنایی با Net Core / .Net و C#\n",
312
+ "- تجربه در استفاده از Microsoft One Note و Microsoft Access\n",
313
+ "- مسلط به زبان‌های برنامه‌نویسی C و Python\n",
314
+ "- توانایی کار با OpenCV و Keras\n",
315
+ "- تجربه استفاده از Microsoft Visual Studio\n",
316
+ "\n",
317
+ "اطلاعات تماس:\n",
318
+ "تلفن: ۰۹۱۳۲۱۷۷۵۵۹\n",
319
+ "ایمیل: [email protected]\n",
320
+ "\n",
321
+ "پروفایل GitHub: https://github.com/MaryamNourii?tab=repos…\n",
322
+ "وب‌سایت شخصی: www.jobvision.ir\n",
323
+ "\n",
324
+ "تاریخ آخرین به‌روزرسانی رزومه: ۲۰ دی ۱۴۰۲\n",
325
+ "شماره رزومه: JV-16905476\n",
326
+ "\n",
327
+ "توضیحات تکمیلی:\n",
328
+ "- دارای مهارت‌های خوب در حوزه هوش مصنوعی\n"
329
+ ]
330
+ }
331
+ ]
332
+ },
333
+ {
334
+ "cell_type": "code",
335
+ "source": [
336
+ "from google.colab import drive\n",
337
+ "drive.mount('/content/drive')"
338
+ ],
339
+ "metadata": {
340
+ "colab": {
341
+ "base_uri": "https://localhost:8080/"
342
+ },
343
+ "id": "QuZdeTmhTXTe",
344
+ "outputId": "6777f3b3-4b84-4d98-e896-05749f5e46d8"
345
+ },
346
+ "execution_count": null,
347
+ "outputs": [
348
+ {
349
+ "output_type": "stream",
350
+ "name": "stdout",
351
+ "text": [
352
+ "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n"
353
+ ]
354
+ }
355
+ ]
356
+ },
357
+ {
358
+ "cell_type": "code",
359
+ "source": [
360
+ "!pip install openai==0.28\n"
361
+ ],
362
+ "metadata": {
363
+ "colab": {
364
+ "base_uri": "https://localhost:8080/"
365
+ },
366
+ "id": "qgxyfMypKQEr",
367
+ "outputId": "e5ba2be5-1835-45f6-ec42-714eacb3d232"
368
+ },
369
+ "execution_count": null,
370
+ "outputs": [
371
+ {
372
+ "output_type": "stream",
373
+ "name": "stdout",
374
+ "text": [
375
+ "Collecting openai==0.28\n",
376
+ " Downloading openai-0.28.0-py3-none-any.whl (76 kB)\n",
377
+ "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━��━━━━━\u001b[0m \u001b[32m0.0/76.5 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.5/76.5 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
378
+ "\u001b[?25hRequirement already satisfied: requests>=2.20 in /usr/local/lib/python3.10/dist-packages (from openai==0.28) (2.31.0)\n",
379
+ "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from openai==0.28) (4.66.4)\n",
380
+ "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from openai==0.28) (3.9.5)\n",
381
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai==0.28) (3.3.2)\n",
382
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai==0.28) (3.7)\n",
383
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai==0.28) (2.0.7)\n",
384
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai==0.28) (2024.6.2)\n",
385
+ "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (1.3.1)\n",
386
+ "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (23.2.0)\n",
387
+ "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (1.4.1)\n",
388
+ "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (6.0.5)\n",
389
+ "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (1.9.4)\n",
390
+ "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (4.0.3)\n",
391
+ "Installing collected packages: openai\n",
392
+ "Successfully installed openai-0.28.0\n"
393
+ ]
394
+ }
395
+ ]
396
+ },
397
+ {
398
+ "cell_type": "code",
399
+ "source": [
400
+ "!pip install openai==0.28\n",
401
+ "import openai\n",
402
+ "import os\n",
403
+ "import pandas as pd\n",
404
+ "\n",
405
+ "# کلید API خود را وارد کنید (مطمئن شوید که این کلید را مخفی نگه دارید)\n",
406
+ "openai.api_key = 'sk-proj-bC6H6QrP6DUqHkn5vOkYT3BlbkFJsSyvL4Bc9c3UEbHrsPMj'\n",
407
+ "\n",
408
+ "def extract_names_from_text(text):\n",
409
+ " prompt = f\"\"\"\n",
410
+ " از متن زیر، فقط شغل افراد را استخراج کنید.\n",
411
+ " متن:\n",
412
+ " {text}\n",
413
+ " \"\"\"\n",
414
+ " response = openai.ChatCompletion.create(\n",
415
+ " model=\"gpt-3.5-turbo\",\n",
416
+ " messages=[\n",
417
+ " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
418
+ " {\"role\": \"user\", \"content\": prompt}\n",
419
+ " ],\n",
420
+ " max_tokens=500,\n",
421
+ " n=1,\n",
422
+ " stop=None,\n",
423
+ " temperature=0.5,\n",
424
+ " )\n",
425
+ " names = response.choices[0].message['content'].strip()\n",
426
+ " # Assuming names are separated by new lines\n",
427
+ " return names.split('\\n')\n",
428
+ "\n",
429
+ "# مسیر پوشه‌ای که فایل‌های متنی در آن قرار دارند\n",
430
+ "directory_path = '/content/drive/MyDrive/Resume_txt'\n",
431
+ "\n",
432
+ "# لیستی برای ذخیره نام‌ها\n",
433
+ "all_names = []\n",
434
+ "\n",
435
+ "# برای هر فایل در پوشه\n",
436
+ "for filename in os.listdir(directory_path):\n",
437
+ " if filename.endswith('.txt'):\n",
438
+ " file_path = os.path.join(directory_path, filename)\n",
439
+ " # خواندن محتوای فایل\n",
440
+ " with open(file_path, 'r', encoding='utf-8') as file:\n",
441
+ " text = file.read()\n",
442
+ " # استخراج نام‌ها از متن\n",
443
+ " names = extract_names_from_text(text)\n",
444
+ " # اضافه کردن نام‌ها به لیست کلی\n",
445
+ " all_names.extend(names)\n",
446
+ "\n",
447
+ "# ایجاد DataFrame از نام‌ها\n",
448
+ "df = pd.DataFrame(all_names, columns=['Name'])\n",
449
+ "\n",
450
+ "# ذخیره DataFrame به عنوان فایل اکسل\n",
451
+ "output_file = '/content/drive/MyDrive/job_output.xlsx'\n",
452
+ "df.to_excel(output_file, index=False)\n",
453
+ "\n",
454
+ "print('Names have been extracted and saved to Excel file.')"
455
+ ],
456
+ "metadata": {
457
+ "colab": {
458
+ "base_uri": "https://localhost:8080/"
459
+ },
460
+ "id": "KNd8lqq3TX5j",
461
+ "outputId": "452ee8d0-e4d5-420c-dc09-e84dbb0b415a"
462
+ },
463
+ "execution_count": null,
464
+ "outputs": [
465
+ {
466
+ "output_type": "stream",
467
+ "name": "stdout",
468
+ "text": [
469
+ "Requirement already satisfied: openai==0.28 in /usr/local/lib/python3.10/dist-packages (0.28.0)\n",
470
+ "Requirement already satisfied: requests>=2.20 in /usr/local/lib/python3.10/dist-packages (from openai==0.28) (2.31.0)\n",
471
+ "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from openai==0.28) (4.66.4)\n",
472
+ "Requirement already satisfied: aiohttp in /usr/local/lib/python3.10/dist-packages (from openai==0.28) (3.9.5)\n",
473
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai==0.28) (3.3.2)\n",
474
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai==0.28) (3.7)\n",
475
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai==0.28) (2.0.7)\n",
476
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.20->openai==0.28) (2024.6.2)\n",
477
+ "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (1.3.1)\n",
478
+ "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (23.2.0)\n",
479
+ "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (1.4.1)\n",
480
+ "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (6.0.5)\n",
481
+ "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (1.9.4)\n",
482
+ "Requirement already satisfied: async-timeout<5.0,>=4.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp->openai==0.28) (4.0.3)\n",
483
+ "Names have been extracted and saved to Excel file.\n"
484
+ ]
485
+ }
486
+ ]
487
+ },
488
+ {
489
+ "cell_type": "code",
490
+ "source": [
491
+ "import openai\n",
492
+ "import os\n",
493
+ "\n",
494
+ "# کلید API خود را وارد کنید\n",
495
+ "openai.api_key = 'sk-proj-bC6H6QrP6DUqHkn5vOkYT3BlbkFJsSyvL4Bc9c3UEbHrsPMj'\n",
496
+ "\n",
497
+ "def parse_response(response_text):\n",
498
+ " data = {}\n",
499
+ " lines = response_text.split('\\n')\n",
500
+ " for line in lines:\n",
501
+ " key_value = line.split(':')\n",
502
+ " if len(key_value) == 2:\n",
503
+ " key, value = key_value\n",
504
+ " data[key.strip()] = value.strip()\n",
505
+ " return data\n",
506
+ "\n",
507
+ "def create_optimized_resume(info):\n",
508
+ " prompt = f\"\"\"\n",
509
+ " من اطلاعات زیر را به شما می‌دهم، لطفاً یک رزومه حرفه‌ای و منظم برای من ایجاد کنید.\n",
510
+ " اطلاعات:\n",
511
+ " {info}\n",
512
+ " رزومه حرفه‌ای و منظم:\n",
513
+ " \"\"\"\n",
514
+ " response = openai.ChatCompletion.create(\n",
515
+ " model=\"gpt-3.5-turbo\",\n",
516
+ " messages=[\n",
517
+ " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
518
+ " {\"role\": \"user\", \"content\": prompt}\n",
519
+ " ],\n",
520
+ " max_tokens=500,\n",
521
+ " n=1,\n",
522
+ " stop=None,\n",
523
+ " temperature=0.5,\n",
524
+ " )\n",
525
+ "\n",
526
+ " structured_data = parse_response(response.choices[0].message['content'].strip())\n",
527
+ "\n",
528
+ " # قالب رزومه\n",
529
+ " template = \"\"\"\n",
530
+ " نام: {name}\n",
531
+ " سن: {age}\n",
532
+ " محل اقامت: {location}\n",
533
+ "\n",
534
+ " وضعیت تأهل: {marital_status}\n",
535
+ " جنسیت: {gender}\n",
536
+ " وضعیت خدمت سربازی: {military_status}\n",
537
+ "\n",
538
+ " وضعیت شغلی: {job_status}\n",
539
+ " علاقه: {interest}\n",
540
+ " نوع شغل مورد نظر: {desired_job}\n",
541
+ " حقوق مورد انتظار: {expected_salary}\n",
542
+ "\n",
543
+ " تحصیلات:\n",
544
+ " {education}\n",
545
+ "\n",
546
+ " مهارت‌ها:\n",
547
+ " {skills}\n",
548
+ "\n",
549
+ " علایق شغلی:\n",
550
+ " {job_interests}\n",
551
+ "\n",
552
+ " مها��ت‌های نرم:\n",
553
+ " {soft_skills}\n",
554
+ "\n",
555
+ " زبان:\n",
556
+ " {languages}\n",
557
+ " \"\"\"\n",
558
+ "\n",
559
+ " optimized_resume = template.format(\n",
560
+ " name=structured_data.get('نام', 'نام وارد نشده'),\n",
561
+ " age=structured_data.get('سن', 'سن وارد نشده'),\n",
562
+ " location=structured_data.get('محل اقامت', 'شهر وارد نشده'),\n",
563
+ " marital_status=structured_data.get('وضعیت تأهل', 'وضعیت تأهل وارد نشده'),\n",
564
+ " gender=structured_data.get('جنسیت', 'جنسیت وارد نشده'),\n",
565
+ " military_status=structured_data.get('وضعیت خدمت سربازی', 'وضعیت خدمت سربازی وارد نشده'),\n",
566
+ " job_status=structured_data.get('وضعیت شغلی', 'وضعیت شغلی وارد نشده'),\n",
567
+ " interest=structured_data.get('علاقه', 'علاقه وارد نشده'),\n",
568
+ " desired_job=structured_data.get('نوع شغل مورد نظر', 'نوع شغل مورد نظر وارد نشده'),\n",
569
+ " expected_salary=structured_data.get('حقوق مورد انتظار', 'حقوق وارد نشده'),\n",
570
+ " education=structured_data.get('تحصیلات', 'تحصیلات وارد نشده'),\n",
571
+ " skills=structured_data.get('مهارت‌ها', 'مهارت‌ها وارد نشده'),\n",
572
+ " job_interests=structured_data.get('علایق شغلی', 'علایق شغلی وارد نشده'),\n",
573
+ " soft_skills=structured_data.get('مهارت‌های نرم', 'مهارت‌های نرم وارد نشده'),\n",
574
+ " languages=structured_data.get('زبان', 'زبان وارد نشده')\n",
575
+ " )\n",
576
+ "\n",
577
+ " return optimized_resume\n",
578
+ "\n",
579
+ "# مسیر پوشه‌ای که فایل‌های متنی در آن قرار دارند\n",
580
+ "directory_path = '/content/'\n",
581
+ "\n",
582
+ "# برای هر فایل در پوشه\n",
583
+ "for filename in os.listdir(directory_path):\n",
584
+ " if filename.endswith('.txt'):\n",
585
+ " file_path = os.path.join(directory_path, filename)\n",
586
+ " # خواندن محتوای فایل\n",
587
+ " with open(file_path, 'r', encoding='utf-8') as file:\n",
588
+ " info = file.read()\n",
589
+ " # ایجاد رزومه بهینه\n",
590
+ " optimized_resume = create_optimized_resume(info)\n",
591
+ " # ذخیره محتوای بهینه شده در همان فایل\n",
592
+ " with open(file_path, 'w', encoding='utf-8') as file:\n",
593
+ " file.write(optimized_resume)\n",
594
+ " print(f'File {filename} has been optimized and saved.')\n",
595
+ "print('All files have been processed.')"
596
+ ],
597
+ "metadata": {
598
+ "colab": {
599
+ "base_uri": "https://localhost:8080/"
600
+ },
601
+ "id": "8q8RHAprT_u1",
602
+ "outputId": "00b83931-d4d5-43cb-e1f4-2f9cf7bc2fc3"
603
+ },
604
+ "execution_count": null,
605
+ "outputs": [
606
+ {
607
+ "output_type": "stream",
608
+ "name": "stdout",
609
+ "text": [
610
+ "File caafc824-838e-4ebf-8ff6-d60f763f8816.txt has been optimized and saved.\n",
611
+ "All files have been processed.\n"
612
+ ]
613
+ }
614
+ ]
615
+ },
616
+ {
617
+ "cell_type": "code",
618
+ "source": [
619
+ "import openai\n",
620
+ "import pandas as pd\n",
621
+ "\n",
622
+ "# کلید API خود را وارد کنید (مطمئن شوید که این کلید را مخفی نگه دارید)\n",
623
+ "openai.api_key = 'sk-proj-bC6H6QrP6DUqHkn5vOkYT3BlbkFJsSyvL4Bc9c3UEbHrsPMj'\n",
624
+ "\n",
625
+ "def is_job(name):\n",
626
+ " prompt = f\"\"\"\n",
627
+ " آیا عبارت زیر نام یک معرفی تحصیلات یک فرد است؟ فقط بله یا خیر پاسخ دهید.\n",
628
+ " عبارت: {name}\n",
629
+ " \"\"\"\n",
630
+ " response = openai.ChatCompletion.create(\n",
631
+ " model=\"gpt-3.5-turbo\",\n",
632
+ " messages=[\n",
633
+ " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n",
634
+ " {\"role\": \"user\", \"content\": prompt}\n",
635
+ " ],\n",
636
+ " max_tokens=5,\n",
637
+ " n=1,\n",
638
+ " stop=None,\n",
639
+ " temperature=0,\n",
640
+ " )\n",
641
+ " answer = response.choices[0].message['content'].strip().lower()\n",
642
+ " return 'بله' in answer or 'yes' in answer\n",
643
+ "\n",
644
+ "# مسیر فایل اکسل ورودی\n",
645
+ "input_file = '/content/drive/MyDrive/education_output.xlsx'\n",
646
+ "# مسیر فایل اکسل خروجی\n",
647
+ "output_file = '/content/drive/MyDrive/F_education_output.xlsx'\n",
648
+ "\n",
649
+ "# خواندن فایل اکسل\n",
650
+ "df = pd.read_excel(input_file)\n",
651
+ "\n",
652
+ "# فیلتر کردن سطرهایی که شامل شغل هستند\n",
653
+ "df['is_job'] = df['Name'].apply(is_job)\n",
654
+ "filtered_df = df[df['is_job'] == True].drop(columns=['is_job'])\n",
655
+ "\n",
656
+ "# ذخیره DataFrame فیلتر شده به عنوان فایل اکسل\n",
657
+ "filtered_df.to_excel(output_file, index=False)\n",
658
+ "\n",
659
+ "print('Filtered jobs have been saved to the output Excel file.')"
660
+ ],
661
+ "metadata": {
662
+ "colab": {
663
+ "base_uri": "https://localhost:8080/"
664
+ },
665
+ "id": "Mpvdcd1T4YYp",
666
+ "outputId": "d2004d39-d4e2-4e37-993f-738b37eef9d7"
667
+ },
668
+ "execution_count": null,
669
+ "outputs": [
670
+ {
671
+ "output_type": "stream",
672
+ "name": "stdout",
673
+ "text": [
674
+ "Filtered jobs have been saved to the output Excel file.\n"
675
+ ]
676
+ }
677
+ ]
678
+ },
679
+ {
680
+ "cell_type": "code",
681
+ "source": [
682
+ "import pandas as pd\n",
683
+ "\n",
684
+ "# مسیر فایل اکسل ورودی\n",
685
+ "input_file = '/content/drive/MyDrive/jobs_output.xlsx'\n",
686
+ "# مسیر فایل اکسل خروجی\n",
687
+ "output_file = '/content/drive/MyDrive/job_output_W.xlsx'\n",
688
+ "\n",
689
+ "# خواندن فایل اکسل\n",
690
+ "df = pd.read_excel(input_file)\n",
691
+ "\n",
692
+ "# لیستی برای ذخیره کلمات جداشده\n",
693
+ "separated_words = []\n",
694
+ "\n",
695
+ "# جدا کردن کلمات هر سطر و اضافه کردن به لیست\n",
696
+ "for row in df['Name']:\n",
697
+ " words = row.split()\n",
698
+ " separated_words.extend(words)\n",
699
+ "\n",
700
+ "# ایجاد DataFrame جدید از کلمات جداشده\n",
701
+ "new_df = pd.DataFrame(separated_words, columns=['Name'])\n",
702
+ "\n",
703
+ "# ذخیره DataFrame جدید به عنوان فایل اکسل\n",
704
+ "new_df.to_excel(output_file, index=False)\n",
705
+ "\n",
706
+ "print('Separated words have been saved to the output Excel file.')"
707
+ ],
708
+ "metadata": {
709
+ "colab": {
710
+ "base_uri": "https://localhost:8080/"
711
+ },
712
+ "id": "SGAsssu3UBqV",
713
+ "outputId": "2c3e59cb-ea06-411f-d156-21960e84fc43"
714
+ },
715
+ "execution_count": null,
716
+ "outputs": [
717
+ {
718
+ "output_type": "stream",
719
+ "name": "stdout",
720
+ "text": [
721
+ "Separated words have been saved to the output Excel file.\n"
722
+ ]
723
+ }
724
+ ]
725
+ },
726
+ {
727
+ "cell_type": "code",
728
+ "source": [],
729
+ "metadata": {
730
+ "id": "pQEVyPv_VC72"
731
+ },
732
+ "execution_count": null,
733
+ "outputs": []
734
+ }
735
+ ]
736
+ }
resume_data_mining (1).ipynb ADDED
The diff for this file is too large to render. See raw diff