Spaces:
Running
Running
File size: 25,331 Bytes
eae8f54 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | risk_list = """
"èªç¶çœå®³":"å°éãæŽªæ°Žãå°é¢šãç°åžžæ°è±¡ã«ãã被害ãªã©",
"補é ç©è²¬ä»»":"補åã®ççµïŒããïŒããªã³ãŒã«ãªã©",
"ãµã€ããŒã»ãã¥ãªãã£":"ãµã€ããŒæ»æãããŒã¿æŒæŽ©ãªã©",
"äºæ
":"亀éäºæ
ãèšå亀æžãªã©",
"ææç":"æ°åãŠã€ã«ã¹ã®ãã³ãããã¯ãªã©",
"ç°å¢åé¡":"å·¥å Žææ°Žã®äžé©åãªåŠçãªã©"
"äžæ£äŒèš":"ç²é£Ÿæ±ºç®ã暪é ãªã©",
"調éäŸ¡æ Œ":"åææãåæ²¹äŸ¡æ Œã®é«éš°ãªã©",
"æè³æŽ»å":"æè³æŽ»åã®å€±æã«ããæå€±ãªã©",
"""
company_risk_list = risk_list
# risk list ex
risk_ex_t = {
"ex1": {
"news": "å°é¢š7å·ã¯ããã11æ¥åå3æãã匷ããå°é¢šããããéåžžã«åŒ·ããå¢åã«å€ãããŸãããããã11æ¥ã®å€æ¹ã«ãããŠå°ç¬ åè«žå³¶ã«ææ¥è¿ããå°ç¬ å諞島ã¯å€§èãã®å€©æ°ã§ãããã14æ¥(æ)ã«ã¯å¢åã¯äžã€ã©ã³ã¯ãäžãããã®ã®ãã匷ããå¢åã§æŽé¢šåã䌎ã£ãŠæ¬å·ã«æ¥è¿ãã15æ¥(ç«)é ãã16æ¥(æ°Ž)ã«ãããŠæ±æ¥æ¬ãè¥¿æ¥æ¬ã«ããªãæ¥è¿ãäžéžããæãããããŸãã",
"company_info": "æ ªåŒäŒç€Ÿãã«ãŒãªãŒã·ã£ã³ããŒãº\n\näºæ¥å
容:\nãã«ãŒãªãŒã·ã£ã³ããŒãºã¯ãæç¶å¯èœãªæµ·æŽè³æºãå©çšããå¥åº·é£åã®éçºã»è²©å£²ãè¡ã£ãŠããŸããç¹ã«ãé«åè³ªãªæµ·è»é¡ã䜿çšããååãé«ãè©äŸ¡ãåããŠããŸãã\n\nåžå Žæ
å ±:\nå¥åº·å¿åãšç°å¢ä¿è·æèã®é«ãŸãã«ãããæç¶å¯èœãªé£ååžå Žãæ¡å€§ããŠããŸãããã«ãŒãªãŒã·ã£ã³ããŒãºã¯ããã®ãã¬ã³ãã«ä¹ããŠåžå Žã·ã§ã¢ãæ¡å€§ããŠããŸãã\n\nããžãã¹å±é:\nåœå
販売ã«å ããã¢ãžã¢åãžã®èŒžåºã匷åããŠããŸãã2024幎床ã«ã¯ãæ°ããªå¥åº·é£åã®ã©ã€ã³ããããåžå Žã«æå
¥ããäºå®ã§ãã",
"risk_list": '{"èªç¶çœå®³":"æç¶å¯èœãªæµ·æŽè³æºãå©çšããå¥åº·é£åã®éçºã»è²©å£²ãè¡ã£ãŠãããããå°éãæŽªæ°Žãå°é¢šãç°åžžæ°è±¡ã«ããæµ·æŽè³æºãžã®è¢«å®³ããªã¹ã¯ãšãªãã","ææç":"åœå
販売åã³ã¢ãžã¢åãžã®èŒžåºã匷åããŠãããããæ°åãŠã€ã«ã¹ã®ãã³ãããã¯ãæ¥åããµãã©ã€ãã§ãŒã³ã«åœ±é¿ãäžãããªã¹ã¯ãããã","ç°å¢åé¡":"æç¶å¯èœãªæµ·æŽè³æºãå©çšããŠããäŒæ¥ã§ãããç°å¢ä¿è·æèã®é«ãŸãã®äžã§å·¥å Žææ°Žã®äžé©åãªåŠçãªã©ãçºèŠãããšäŒæ¥ã€ã¡ãŒãžã«æå®³ãäžããå¯èœæ§ãããã","調éäŸ¡æ Œ":"é«åè³ªãªæµ·è»é¡ãªã©ã®åææã䜿çšããŠãããããåææäŸ¡æ Œã®é«éš°ãã³ã¹ãå¢å ã«ã€ãªãããåçæ§ã«åœ±é¿ãäžãããªã¹ã¯ãããã"}',
"risk": '{"ja": "yes", "risk": "yes", "risk_key":"èªç¶çœå®³","reason":"å°é¢š7å·ã¯ããã11æ¥åå3æãã匷ããå°é¢šããããéåžžã«åŒ·ããå¢åã«å€ãããŸããã"}',
"title": '{"title":"[èªç¶çœå®³]å°é¢š7å·æ¥è¿ãæç¶å¯èœãªæµ·æŽè³æºäŒæ¥ãžã®åœ±é¿ãã確èªãé¡ãèŽããŸãã"}',
"summary": '{"summary":"å°é¢š7å·ã¯ããã11æ¥åå3æãã匷ããå°é¢šããããéåžžã«åŒ·ããå¢åã«å€ãããŸããã15æ¥(ç«)é ãã16æ¥(æ°Ž)ã«ãããŠæ±æ¥æ¬ãè¥¿æ¥æ¬ã«ããªãæ¥è¿ãäžéžããæãããããŸãã"}',
"alert": '{"alert":"!!å°é¢š7å·æ¥è¿ãéåžžã«æªå€©åãæœåšçãªè¢«å®³ãããã³æ··ä¹±ã®é«ããªã¹ã¯ãæµ·æŽè³æºã®ç¢ºä¿ãšç©æµã«åœ±é¿ãåºãæãããããŸããäŒæ¥ã¯ãæŽé¢šåã®åœ±é¿ãåããåã«ã察çãè¬ããå¿
èŠããããŸãã!!"}',
},
"ex2": {
"news": "JetBrainsãæäŸããCI/CDããŒã«ãTeamCityãã«æ·±å»ãªè匱æ§ãCVE-2024-23917ããæãããšãªã£ããæªçšããããšãªã¢ãŒãããã³ãŒããå®è¡ããããããããããå補åã«èªèšŒåé¿ã®è匱æ§ãCVE-2024-23917ããæãããšãªã£ããã®ãHTTPçµç±ã§ã¢ã¯ã»ã¹ã§ããå ŽåãèªèšŒããã€ãã¹ããŠãTeamCityãµãŒããã®ç®¡çãè¡ãããšãå¯èœãšãªãããªã¢ãŒãããã³ãŒããå®è¡ãããããããããã",
"company_info": "æ ªåŒäŒç€Ÿãµã¯ã©ãã¯ãããžãŒ\n\näºæ¥å
容:\nãµã¯ã©ãã¯ãããžãŒã¯ãæå
端ã®AIæè¡ã掻çšããŠãè£œé æ¥åãã®èªååãœãªã¥ãŒã·ã§ã³ãæäŸããŠããŸããç¹ã«ããããã£ã¯ã¹ãšããŒã¿åæãçµã¿åããã補åã§åžå ŽããªãŒãããŠããŸãã\n\nåžå Žæ
å ±:\nè£œé æ¥ã®èªååããŒãºã®å¢å ã«äŒŽãããµã¯ã©ãã¯ãããžãŒã®åžå Žã¯å¹Žå¹³å15%ã®æé·ãèŠèŸŒãŸããŠããŸããç¹ã«ãèªåè»ããã³é»åæ©åšè£œé æ¥çããã®åŒ·ãéèŠããããŸãã\n\nããžãã¹å±é:\nåœå
åžå Žã«å ããŠãåç±³ãšãšãŒãããåžå Žãžã®é²åºãèšç»ããŠããã2025幎ãŸã§ã«å
šäžçã§ã®äºæ¥å±éãç®æããŠããŸãããŸããæ°ããAIæè¡ã®ç ç©¶éçºã«ãåãå
¥ããŠãããæ¬¡äžä»£è£œåã®éçºã«æ³šåããŠããŸãã",
"risk_list": '{"ãµã€ããŒã»ãã¥ãªãã£": "æå
端ã®AIæè¡ã掻çšããŠããããããµã€ããŒæ»æãããŒã¿æŒæŽ©ã®ãªã¹ã¯ãããã","äžæ£äŒèš": "æ¡å€§ããäºæ¥èŠæš¡ãšè€éåããçµå¶ç¶æ³ã«ãããç²é£Ÿæ±ºç®ã暪é ãªã©ã®è²¡åäžæ£ãªã¹ã¯ã","æè³æŽ»å": "æ°ããAIæè¡ã®ç ç©¶éçºã«åãå
¥ããŠãããæ¬¡äžä»£è£œåã®éçºã«æ³šåããŠããããšãããæè³æŽ»åã®å€±æã«ããæå€±ãçºçãããªã¹ã¯ãããã"}',
"risk": '{"ja": "yes", "risk": "yes", "risk_key":"ãµã€ããŒã»ãã¥ãªãã£","reason":"JetBrainsãæäŸããCI/CDããŒã«ãTeamCityãã«æ·±å»ãªè匱æ§ãCVE-2024-23917ããæãããšãªã£ãã"}',
"title": '{"title":"[ãµã€ããŒã»ãã¥ãªãã£] JetBrainsã®CI/CDããŒã«ãTeamCityãã«æ·±å»ãªè匱æ§çºèŠããµã¯ã©ãã¯ãããžãŒã®è£œé èªååãžã®åœ±é¿"}',
"summary": '{"summary":"JetBrainsã®CI/CDããŒã«ãTeamCityãã«æ·±å»ãªè匱æ§ãCVE-2024-23917ããçºèŠãããŸããã ãã®è匱æ§ãæªçšãããšããªã¢ãŒãããã³ãŒããå®è¡ãããå±éºæ§ããããŸãã"}',
"alert": '{"alert":"!!éèŠ!!JetBrainsã®CI/CDããŒã«ãTeamCityãã«æ·±å»ãªè匱æ§ãCVE-2024-23917ããçºèŠãããŸããããã®ããŒã«ã䜿çšããŠããå ŽåãçŽã¡ã«å¯Ÿçãè¬ããå¿
èŠããããŸããããã¯ãå瀟ã®AIãšèªååãœãªã¥ãŒã·ã§ã³ã®å®å
šæ§ããã³ä¿¡é Œæ§ã«çŽæ¥çãªåœ±é¿ãåãŒãå¯èœæ§ããããŸãã!!"}',
},
"ex3": {
"news": "2024幎1æ1æ¥16æ10åé ãç³å·çèœç»å°æ¹ãéæºãšãããã°ããã¥ãŒã7.6ïŒæå€§é床7ïŒã®å°éãçºçããŸããã 被çœãããæ¹ã
ã«ã¯è¬¹ãã§ãèŠèãç³ãäžããŸãã æ¬å°éã«ãããæ¬æè³æ³äººã®ä¿æç©ä»¶æåšå°ã®æå€§é床ã¯4ã§ãããçŸåšã®ãšãã人ç被害ãéçšç¶æ³ã«éèŠãªåœ±é¿ãåãŒã被害çã¯ç¢ºèªãããŠãããŸããã",
"company_info": "æ ªåŒäŒç€Ÿãã«ãŒãªãŒã·ã£ã³ããŒãº\n\näºæ¥å
容:\nãã«ãŒãªãŒã·ã£ã³ããŒãºã¯ãæç¶å¯èœãªæµ·æŽè³æºãå©çšããå¥åº·é£åã®éçºã»è²©å£²ãè¡ã£ãŠããŸããç¹ã«ãé«åè³ªãªæµ·è»é¡ã䜿çšããååãé«ãè©äŸ¡ãåããŠããŸãã\n\nåžå Žæ
å ±:\nå¥åº·å¿åãšç°å¢ä¿è·æèã®é«ãŸãã«ãããæç¶å¯èœãªé£ååžå Žãæ¡å€§ããŠããŸãããã«ãŒãªãŒã·ã£ã³ããŒãºã¯ããã®ãã¬ã³ãã«ä¹ããŠåžå Žã·ã§ã¢ãæ¡å€§ããŠããŸãã\n\nããžãã¹å±é:\nåœå
販売ã«å ããã¢ãžã¢åãžã®èŒžåºã匷åããŠããŸãã2024幎床ã«ã¯ãæ°ããªå¥åº·é£åã®ã©ã€ã³ããããåžå Žã«æå
¥ããäºå®ã§ãã",
"risk_list": '{"èªç¶çœå®³":"æç¶å¯èœãªæµ·æŽè³æºãå©çšããå¥åº·é£åã®éçºã»è²©å£²ãè¡ã£ãŠãããããå°éãæŽªæ°Žãå°é¢šãç°åžžæ°è±¡ã«ããæµ·æŽè³æºãžã®è¢«å®³ããªã¹ã¯ãšãªãã","ææç":"åœå
販売åã³ã¢ãžã¢åãžã®èŒžåºã匷åããŠãããããæ°åãŠã€ã«ã¹ã®ãã³ãããã¯ãæ¥åããµãã©ã€ãã§ãŒã³ã«åœ±é¿ãäžãããªã¹ã¯ãããã","ç°å¢åé¡":"æç¶å¯èœãªæµ·æŽè³æºãå©çšããŠããäŒæ¥ã§ãããç°å¢ä¿è·æèã®é«ãŸãã®äžã§å·¥å Žææ°Žã®äžé©åãªåŠçãªã©ãçºèŠãããšäŒæ¥ã€ã¡ãŒãžã«æå®³ãäžããå¯èœæ§ãããã","調éäŸ¡æ Œ":"é«åè³ªãªæµ·è»é¡ãªã©ã®åææã䜿çšããŠãããããåææäŸ¡æ Œã®é«éš°ãã³ã¹ãå¢å ã«ã€ãªãããåçæ§ã«åœ±é¿ãäžãããªã¹ã¯ãããã"}',
"risk": '{"ja": "yes", "risk": "yes", "risk_key":"èªç¶çœå®³","reason":"2024幎1æ1æ¥16æ10åé ãç³å·çèœç»å°æ¹ãéæºãšãããã°ããã¥ãŒã7.6ïŒæå€§é床7ïŒã®å°éãçºçããŸããã"}',
"title": '{"title":"[èªç¶çœå®³]é床4ã®èŠéïŒæç¶å¯èœãªé£ååžå Žã«ãããçœå®³ãªã¹ã¯"}',
"summary": '{"summary":"2024幎1æ1æ¥16æ10åé ãç³å·çèœç»å°æ¹ãéæºãšãããã°ããã¥ãŒã7.6ïŒæå€§é床7ïŒã®å°éãçºçããŸãããä¿æç©ä»¶ã®æå€§é床ã¯4ã§ãæ¬å°éã«ãããæ¬æè³æ³äººã®ä¿æç©ä»¶æåšå°ã®æå€§é床ã¯4ã§ãããçŸåšã®ãšãã人ç被害ãéçšç¶æ³ã«éèŠãªåœ±é¿ãåãŒã被害çã¯ç¢ºèªãããŠãããŸããã"}',
"alert": '{"alert":"!!ç³å·çèœç»å°æ¹ã§çºçããM7.6ã®å°éãæå€§é床7ãäºæ¥æŽ»åãžã®çŽæ¥çãªåœ±é¿ã¯çŸæç¹ã§å ±åãããŠããŸããããå°éãæç¶å¯èœãªæµ·æŽè³æºãžåãŒãå¯èœæ§ã®ãã圱é¿ã«æ³šæãå¿
èŠã§ããé床4ã®æºããå ±åãããå°åã«ä¿æç©ä»¶ãååšãããããåŒãç¶ãç¶æ³ã泚èŠããå¿
èŠã«å¿ããæªçœ®ãè¬ããããšãæšå¥šããŸãã"}',
},
}
risk_ex_f = {
"ex1": {
"news": "è±å·»æ±é«ïŒå²©æïŒã§éç®140æ¬å¡æãæŸã£ãäœã
æšéºå€ªéå
éæããç±³ã¹ã¿ã³ãã©ãŒã倧åŠãžé²åŠããããšã決ãŸã£ããå倧åŠãå
¬åŒããŒã ããŒãžã§çºè¡šããã",
"company_info": "æ ªåŒäŒç€Ÿãã«ãŒãªãŒã·ã£ã³ããŒãº \n äºæ¥å
容: \n ãã«ãŒãªãŒã·ã£ã³ããŒãºã¯ãæç¶å¯èœãªæµ·æŽè³æºãå©çšããå¥åº·é£åã®éçºã»è²©å£²ãè¡ã£ãŠããŸããç¹ã«ãé«åè³ªãªæµ·è»é¡ã䜿çšããååãé«ãè©äŸ¡ãåããŠããŸãã \n åžå Žæ
å ±: \n å¥åº·å¿åãšç°å¢ä¿è·æèã®é«ãŸãã«ãããæç¶å¯èœãªé£ååžå Žãæ¡å€§ããŠããŸãããã«ãŒãªãŒã·ã£ã³ããŒãºã¯ããã®ãã¬ã³ãã«ä¹ããŠåžå Žã·ã§ã¢ãæ¡å€§ããŠããŸãã \n ããžãã¹å±é: \n åœå
販売ã«å ããã¢ãžã¢åãžã®èŒžåºã匷åããŠããŸãã2024幎床ã«ã¯ãæ°ããªå¥åº·é£åã®ã©ã€ã³ããããåžå Žã«æå
¥ããäºå®ã§ãã",
"risk_list": '{"èªç¶çœå®³":"æç¶å¯èœãªæµ·æŽè³æºãå©çšããå¥åº·é£åã®éçºã»è²©å£²ãè¡ã£ãŠãããããå°éãæŽªæ°Žãå°é¢šãç°åžžæ°è±¡ã«ããæµ·æŽè³æºãžã®è¢«å®³ããªã¹ã¯ãšãªãã","ææç":"åœå
販売åã³ã¢ãžã¢åãžã®èŒžåºã匷åããŠãããããæ°åãŠã€ã«ã¹ã®ãã³ãããã¯ãæ¥åããµãã©ã€ãã§ãŒã³ã«åœ±é¿ãäžãããªã¹ã¯ãããã","ç°å¢åé¡":"æç¶å¯èœãªæµ·æŽè³æºãå©çšããŠããäŒæ¥ã§ãããç°å¢ä¿è·æèã®é«ãŸãã®äžã§å·¥å Žææ°Žã®äžé©åãªåŠçãªã©ãçºèŠãããšäŒæ¥ã€ã¡ãŒãžã«æå®³ãäžããå¯èœæ§ãããã","調éäŸ¡æ Œ":"é«åè³ªãªæµ·è»é¡ãªã©ã®åææã䜿çšããŠãããããåææäŸ¡æ Œã®é«éš°ãã³ã¹ãå¢å ã«ã€ãªãããåçæ§ã«åœ±é¿ãäžãããªã¹ã¯ãããã"}',
"risk": '{"ja": "yes", "risk": "no", "risk_key":"","reason":""}',
},
"ex2": {
"news": "ãããããã¯ããŒããŒZãçŸç°å€èåïŒ29ïŒã14æ¥ãæ±äº¬ã»æžè°·ã§è¡ããããã«ã©ãããããïŒãããã³ïŒããããžã§ã¯ãçºè¶³èšè
çºè¡šäŒã«ç»å ŽããKinKiãKidsãå æ¬åïŒ44ïŒãšçµå©çºè¡šåŸãåããŠã®å
¬ã®å Žã§ãå·Šæã«æèŒªã¯ããŠããªãã£ããã幞ããã£ã±ãã®ç¬é¡ãèŠããã",
"company_info": "æ ªåŒäŒç€Ÿãµã¯ã©ãã¯ãããžãŒ \n äºæ¥å
容: ãµã¯ã©ãã¯ãããžãŒã¯ãæå
端ã®AIæè¡ã掻çšããŠãè£œé æ¥åãã®èªååãœãªã¥ãŒã·ã§ã³ãæäŸããŠããŸããç¹ã«ããããã£ã¯ã¹ãšããŒã¿åæãçµã¿åããã補åã§åžå ŽããªãŒãããŠããŸãã \n åžå Žæ
å ±: \n è£œé æ¥ã®èªååããŒãºã®å¢å ã«äŒŽãããµã¯ã©ãã¯ãããžãŒã®åžå Žã¯å¹Žå¹³å15%ã®æé·ãèŠèŸŒãŸããŠããŸããç¹ã«ãèªåè»ããã³é»åæ©åšè£œé æ¥çããã®åŒ·ãéèŠããããŸãã \n ããžãã¹å±é: \n åœå
åžå Žã«å ããŠãåç±³ãšãšãŒãããåžå Žãžã®é²åºãèšç»ããŠããã2025幎ãŸã§ã«å
šäžçã§ã®äºæ¥å±éãç®æããŠããŸãããŸããæ°ããAIæè¡ã®ç ç©¶éçºã«ãåãå
¥ããŠãããæ¬¡äžä»£è£œåã®éçºã«æ³šåããŠããŸãã",
"risk_list": '{"ãµã€ããŒã»ãã¥ãªãã£": "æå
端ã®AIæè¡ã掻çšããŠããããããµã€ããŒæ»æãããŒã¿æŒæŽ©ã®ãªã¹ã¯ãããã","äžæ£äŒèš": "æ¡å€§ããäºæ¥èŠæš¡ãšè€éåããçµå¶ç¶æ³ã«ãããç²é£Ÿæ±ºç®ã暪é ãªã©ã®è²¡åäžæ£ãªã¹ã¯ã","æè³æŽ»å": "æ°ããAIæè¡ã®ç ç©¶éçºã«åãå
¥ããŠãããæ¬¡äžä»£è£œåã®éçºã«æ³šåããŠããããšãããæè³æŽ»åã®å€±æã«ããæå€±ãçºçãããªã¹ã¯ãããã"}',
"risk": '{"ja": "yes", "risk": "no", "risk_key":"","reason":""}',
},
}
# prompt
## company
com_sys_msg = """
You are a helpful business analyst expert designed to \
provide me with the information on risks appearing in the company information and the risk list, \
formatted in JSON.
"""
com_usr_msg = """
Based on the entered company information and the risks provided, \
I want you to select the risks that may occur in the risk list for the entered company. \
This risks should include, but not be limited to, financial, operational, market, and compliance risks associated with the company's specific industry, size, and geographic location. \
Find the original text on which the risk was judged. Output the results in JSON format.
like {{"risk1" : "reason1","risk2":"reason2"}}
Think about it a few more steps \n\n
example:
***
company_information: {c1} \n
risk_list: {r1} \n
output: {o1} \n\n
***
question:
***
company_information: {c2} \n
risk_list: {r2} \n
output:
***
"""
## riskãlist
risk_sys_msg = """
You are a helpful business analyst expert designed to \
provide me with the information on risks appearing in the news, formatted in JSON.
"""
risk_usr_msg_old = """
Enter the news and risks company information that company can refer to. \
Determine whether there is risk information in the news. \
If there is, output yes, the risk information contained, \
and the original news text basis that can be judged. \
If there is no, only output no.
Determine if the news is written in Japanese. Output the results in JSON format. \
like {{'ja': determine if the news is written in Japanese ,'risk': Is there any risk , 'risk_key': Risk type ,'reason': The basis of the original text}} \
Think about it a few more steps \n\n \
news: {n1} \n
company_information: {c1} \n
risk_list:{r1}\n
output:{o1} \n\n
news: {n2} \n
company_information: {c2} \n
risk_list:{r2}\n
output:{o2} \n\n
news: {n3} \n
company_information: {c3} \n
risk_list:{r3}\n
output:{o3} \n\n
news: {n4}\n
company_information: {c4} \n
risk_list:{r4}\n
output:
"""
risk_usr_msg = """
Enter the news and risks company information that company can refer to. \
Determine whether there is risk information in the news. \
If there is, output yes, the risk information contained, \
and the original news text basis that can be judged. \
If there is no, only output no.
Determine if the news is written in Japanese. Output the results in JSON format. \
like {{'ja': determine if the news is written in Japanese ,'risk': Is there any risk , 'risk_key': Risk type ,'reason': The basis of the original text}} \
Think about it a few more steps \n\n \
example:
***
news: {n1} \n
company_information: {c1} \n
risk_list:{r1}\n
output:{o1} \n\n
news: {n3} \n
company_information: {c3} \n
risk_list:{r3}\n
output:{o3} \n\n
***
question:
***
news: {n4}\n
company_information: {c4} \n
risk_list:{r4}\n
output:
***
"""
## title
title_usr_msg = """
I need a compelling and insightful title for a report based on input news and company information. \
The news highlights potential risks or challenges in the {risk} sector. Generate a concise, \
attention-grabbing title that encapsulates the essence of the risks discussed in the news article. \
frame the title to capture the attention of company decision-makers. Output the results in JSON format. \
like {{'title':generated title}} \
Think about it a few more steps \n\n \
example:
***
news: {n1} \n
company_information: {c1} \n
output:{o1} \n\n
news: {n2} \n
company_information: {c2} \n
output:{o2} \n\n
***
question:
***
news: {n3} \n
company_information: {c3} \n
output:
***
"""
## sum
summary_usr_msg = """
I need a concise news summary focusing on risks based on the provided news input. \
Please craft a brief summary that highlights potential risks associated with the given news. Within two sentences\
Output the results in JSON format. \
like {{'summary':generated summary}} \
Think about it a few more steps \n\n \
example:
***
news: {n1} \n
output:{o1} \n\n
news: {n2} \n
output:{o2} \n\n
***
question:
***
news: {n3} \n
output:
"""
## alert msg
alert_usr_msg = """
I need assistance in creating an alert message based on the risk-related content of the entered news and company information. \
As a risk analyst, guide me in generating a concise and informative alert message summarizing the potential {risk} risk highlighted for company in the news. \
This alert is crucial for making timely decisions and assessing the impact of the information. \
Output the results in JSON format.\
like {{'alert':generated alert message}} \
Think about it a few more steps \n\n \
example:
***
news: {n1} \n
company_information: {c1} \n
output:{o1} \n\n
news: {n2} \n
company_information: {c2} \n
output:{o2} \n\n
***
question:
***
news: {n3} \n
company_information: {c3} \n
output:
***
"""
## report
report_msg = """
## ã¢ã©ãŒãã¡ãã»ãŒãž
### {title}
### [ãµããª]
{summary}
### [ã¢ã©ãŒã]
{alert}
### [æ¬æ]
{news}
#### [ãªã¹ã¯]
{risk}
#### [æ ¹æ ]
{reason}
### [äŒç€Ÿãªã¹ã¯]
{company_risk}
"""
## japanese
translate_sys_msg = """
You are a helpful Japanese translation expert designed to \
provide me translate non-Japanese text, formatted in JSON.
"""
translate_usr_msg = """
Translate the following non-Japanese text in a dictionary into formal Japanese for me. \
Do not translate proper nouns. \
If text is Japanese, return unchanged. \
Ensure the correctness of grammar and vocabulary. \
Output the results in JSON format.
like {{'title':translated title,'summary':translated summary,'alert':translated alert,'news':translated news,'risk_key':translated risk_key,'reason':translated reason,'company_risk':translated company_risk}}
input: {dictionary}
output:
"""
news_e = "The lingering storm system that has battered California for days continues to pose a flooding risk for southern parts of the state. A rare tornado warning was issued for parts of San Diego County. The warning has expired, but heavy rain and lightning were still possible. The San Diego region remains under a flood watch through tonight because of excessive rainfall, the National Weather Service said, and residents in mountain areas are being warned about rockslides and rocks on the roads."
news1 = "14æ¥ååŸ6æ33åããã鹿å
å³¶åžã®æ¡å³¶ã»å岳山é ç«å£ã§ççºçåŽç«ããããåŽç
ãç«å£ãã5åã¡ãŒãã«ã®é«ããŸã§äžãã£ããæ°è±¡åºã¯çæ¬ãå®®åŽã鹿å
å³¶åçã®äžéšã«éç°äºå ±ãåºããã鹿å
å³¶çã«ãããšããã人ã建ç©è¢«å®³ã¯ç¢ºèªãããŠããªãã5åã¡ãŒãã«ã«éããã®ã¯ãåãç«å£ã§åŽç«ãã"
news2 = "岞ç°éŠçžïŒèªæ°å
ç·è£ïŒã¯ïŒïŒæ¥ååã®è¡é¢äºç®å§å¡äŒéäžå¯©è°ã§ãèªæ°å
掟é¥ã®æ¿æ²»è³éèŠæ£æ³éåäºä»¶ãåããèŠæ£æ³éåã§äŒèšè²¬ä»»è
ã鮿ã»èµ·èšŽãããå Žåã«è°å¡æ¬äººãåŠåã§ããããå
åãæ¹æ£ããèããæããã«ãããïŒæïŒïŒæ¥ã®å
倧äŒã§æ±ºå®ããæåã ã"
news3 = "楜倩ã°ã«ãŒãã®å»å¹Ž1幎éã®é£çµæ±ºç®ã¯3394ååã®æçµèµ€åã«ãªããŸãããèµ€åé¡ã¯é廿倧ã ã£ãããšãšãããçž®å°ãããã®ã®ãèµ€åã¯5幎é£ç¶ã§ããã®å€§ããªèŠå ãšãªã£ãŠããã®ãã¢ãã€ã«äºæ¥ã§ãããããŸã§ãæºåž¯é»è©±ã®åºå°å±å»ºèšã«ã¯1å
å以äžãæããŠããŸããããã®äžæ¹ã§ãå»å¹Ž12ææç¹ã§ã®å¥çŽè
æ°ã¯609äžä»¶ãšå€§æ3瀟ã®10åã®1以äžã§ãããŸããåºå°å±å»ºèšã«ããã£ãŠçºè¡ãã瀟åµãããããåéã®è¿æžé¡ã¯ä»å¹Žãšæ¥å¹Žã®2幎éã§ããã8000ååã«äžããŸãããäžæšè°·ç€Ÿé·ã¯ãè³éç¹°ãã¯å¿é
ãªãããšåŒ·èª¿ããŸããã"
news4 = "LINEã€ããŒã¯14æ¥ãæ°ãã«åŸæ¥å¡ãªã©ã®å人æ
å ±13äžä»¶ä»¥äžãæµåºããå¯èœæ§ããããšçºè¡šãããLINEã€ããŒã¯2023幎11æã«å€§æ ªäž»ã§ããéåœããã倧æã»NAVERããµã€ããŒæ»æãåããããšã§LINEå©çšè
ã®å人æ
å ±44äžä»¶ãäžæ£ã¢ã¯ã»ã¹ãåããå¯èœæ§ããããšçºè¡šããŠããã远å 調æ»ã®çµæãNAVERã®ãµãŒããŒçµç±ã§åŸæ¥å¡ãªã©ã®æ°åãé¡åçãªã©ãå人æ
å ±ã远å ã§çŽ8äžä»¶ããŸããä»ã®å§èšå
çµç±ã§åŸæ¥å¡ãªã©ã®å人ããŒã¿ã6äžä»¶è¿ããããããŠ13äžä»¶ä»¥äžãæµåºããå¯èœæ§ã確èªãããã"
news5 = "éåœäººä¿³åªã®ãã»ãã³ãœã¯ã14æ¥ãéœå
ã§è¡ãããäž»æŒæ ç»ãç¯çœªéœåž NO WAY OUTãïŒ2æ23æ¥å
¬éïŒã®ãžã£ãã³ãã¬ãã¢ã«ã€ã»ãµã³ãšã³ç£ç£ãéæšåŽé«ãåæéŒãšãšãã«åºåžãåã®å
¬åŒæ¥æ¥ãæãããã"
com1 = "ãã¯ã¹ããšããžãŒãœãªã¥ãŒã·ã§ã³æ ªåŒäŒç€Ÿ\n\näºæ¥å
容:\nåçå¯èœãšãã«ã®ãŒã®æ®åãšå©çšä¿é²ãç®çãšããŠèšç«ããããã¯ã¹ããšããžãŒãœãªã¥ãŒã·ã§ã³ã¯ã倪éœå
çºé»ã颚åçºé»ãªã©ã®èšçœ®ã»éå¶ãææããŠããŸãããŸãããšãã«ã®ãŒç®¡çã·ã¹ãã ã®éçºã«ã泚åããŠããŸãã\n\nåžå Žæ
å ±:\nåçå¯èœãšãã«ã®ãŒãžã®é¢å¿ãé«ãŸãäžãå瀟ã®äºæ¥é åã¯æ¥éã«æé·ããŠããŸããç¹ã«ãäŒæ¥ã®CO2æåºéåæžããŒãºãäºæ¥æ¡å€§ã®å€§ããªãã©ã€ããŒãšãªã£ãŠããŸãã\n\nããžãã¹å±é:\nåœå
åžå Žã§ã®æåãåºã«ãæ±åã¢ãžã¢åžå Žãžã®å±éãé²ããŠããŸãããŸãããšãã«ã®ãŒè²¯èµæè¡ã®ç ç©¶éçºã«ãããæ°ããªããžãã¹ã¢ãã«ã®æ§ç¯ãç®æããŠããŸãã"
com2 = "ã¢ããã³ã¹ããã«ã¹ã±ã¢æ ªåŒäŒç€Ÿ\n\näºæ¥å
容:\nã¢ããã³ã¹ããã«ã¹ã±ã¢ã¯ãå»çæ©åšãšããžã¿ã«ãã«ã¹ãœãªã¥ãŒã·ã§ã³ãèåããã補åãæäŸããŠããŸããç¹ã«ãåšå®
å»çãæ¯æŽããããã€ã¹ã®éçºã«åãå
¥ããŠããŸãã\n\nåžå Žæ
å ±:\né«éœ¢å瀟äŒã®é²å±ãšå
±ã«ãåšå®
å»çåžå Žã¯æ¡å€§åŸåã«ãããŸããåç€Ÿã®æäŸãã驿°çãªè£œåã¯ããã®åžå Žã§ã®éèŠãæããŠããŸãã\n\nããžãã¹å±é:\nåœå
åžå Žã§ã®å®çžŸãåºã«ãåç±³ããã³ãšãŒãããåžå Žãžã®é²åºãèšç»ããŠããŸãããŸããæ°ããå»çæè¡ã®ç ç©¶éçºã«æè³ãç¶ããåžå Žã®ãªãŒããŒãšããŠã®å°äœã確ç«ããããšãç®æããŠããŸãã"
prompt_dict = {
"risk_dict": risk_list,
"company_risk_list": company_risk_list,
"risk_ex_t": risk_ex_t,
"risk_ex_f": risk_ex_f,
"com_sys_msg": com_sys_msg,
"com_usr_msg": com_usr_msg,
"risk_sys_msg": risk_sys_msg,
"risk_usr_msg": risk_usr_msg,
"title_usr_msg": title_usr_msg,
"summary_usr_msg": summary_usr_msg,
"alert_usr_msg": alert_usr_msg,
"report_msg": report_msg,
"translate_sys_msg": translate_sys_msg,
"translate_usr_msg": translate_usr_msg,
}
import pickle
def save_dict(prompt_dict):
with open("prompt_dict.pkl", "wb") as fi:
pickle.dump(prompt_dict, fi)
def load_dict():
with open("prompt_dict.pkl", "rb") as fi:
prompt_dict = pickle.load(fi)
return prompt_dict
|