gpt4 book ai didi

java - 如何从文本中检测编程语言的错误消息?

转载 作者:行者123 更新时间:2023-11-30 20:50:54 25 4
gpt4 key购买 nike

我正在对 github 上软件开发人员的评论进行情感分析。通常他们倾向于在注释中写下错误消息和异常。

我的问题是如何删除这些错误/异常消息?

例如:

评论:

”我今天收到此错误:错误网关 (502) 和 500(内部服务器错误)。您是否会更新代码以不引发错误并显示记录器警告/错误而不是回溯?

Trakt 最近遇到了很多问题。

:~/SickRage/Logs$ grep -Ri "Server Error"
sickbeard.log.1:traktException: 502 Server Error: Bad Gateway
sickbeard.log.1:traktException: 500 Server Error: Internal Server Error
sickbeard.log.1:traktException: 500 Server Error: Internal Server Error
sickbeard.log:traktException: 502 Server Error: Bad Gateway
sickbeard.log:traktException: 520 Server Error: Origin Error

sickbeard.log.1: File "/home/pi/SickRage/sickbeard/traktChecker.py", line 48, in run
sickbeard.log.1: File "/home/pi/SickRage/sickbeard/traktChecker.py", line 127, in updateShows
sickbeard.log.1: watchlist = self.trakt_api.traktRequest("user/watchlist/shows.json/%APIKEY%/%USER%")
sickbeard.log.1: File "/home/pi/SickRage/lib/trakt/trakt.py", line 39, in traktRequest
sickbeard.log.1: raise traktException(e.message)
sickbeard.log.1:traktException: 502 Server Error: Bad Gateway
sickbeard.log.1:2014-11-29 14:16:33 DEBUG TRAKTCHECKER :: Starting new thread: TRAKTCHECKER
sickbeard.log.1:2014-11-29 14:16:33 DEBUG TRAKTCHECKER :: Starting trakt show watchlist check
sickbeard.log.1:2014-11-29 14:16:35 DEBUG TRAKTCHECKER :: No shows found in your watchlist, aborting watchlist update
sickbeard.log.1:2014-11-29 14:16:35 DEBUG TRAKTCHECKER :: Starting trakt episode watchlist check
sickbeard.log.1:2014-11-29 14:17:03 DEBUG TRAKTCHECKER :: Traceback (most recent call last):
sickbeard.log.1: File "/home/pi/SickRage/sickbeard/traktChecker.py", line 49, in run
sickbeard.log.1: File "/home/pi/SickRage/sickbeard/traktChecker.py", line 162, in updateEpisodes
sickbeard.log.1: watchlist = self.trakt_api.traktRequest("user/watchlist/episodes.json/%APIKEY%/%USER%")
sickbeard.log.1: File "/home/pi/SickRage/lib/trakt/trakt.py", line 39, in traktRequest
sickbeard.log.1: raise traktException(e.message)
sickbeard.log.1:traktException: 500 Server Error: Internal Server Error

"

必填:删除评论中的异常部分。

非常感谢:)

最佳答案

考虑匹配这些异常的正则表达式模式,然后使用正则表达式替换语句将此模式替换为“”。这里最困难的部分是确定这些异常的模式,您可能需要进行一些数据挖掘才能做到这一点

关于java - 如何从文本中检测编程语言的错误消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36796149/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com