Back to Search
Start Over
Which Exceptions Do We Have to Catch in the Python Code for AI Projects?
- Source :
- International Journal of Software Engineering & Knowledge Engineering; Mar2023, Vol. 33 Issue 3, p375-394, 20p
- Publication Year :
- 2023
-
Abstract
- Recently, Python is the most-widely used language in artificial intelligence (AI) projects requiring huge amount of CPU and memory resources, and long execution time for training. For saving the project duration and making AI software systems more reliable, it is inevitable to handle exceptions appropriately at the code level. However, handling exceptions highly relies on developer's experience. This is because, as an interpreter-based programming language, it does not force a developer to catch exceptions during development. In order to resolve this issue, we propose an approach to suggesting appropriate exceptions for the AI code segments during development after training exceptions from the existing handling statements in the AI projects. This approach learns the appropriate token units for the exception code and pretrains the embedding model to capture the semantic features of the code. Additionally, the attention mechanism learns to catch the salient features of the exception code. For evaluating our approach, we collected 32,771 AI projects using two popular AI frameworks (i.e. Pytorch and Tensorflow) and we obtained the 0.94 of Area under the Precision-Recall Curve (AUPRC) on average. Experimental results show that the proposed method can support the developer's exception handling with better exception proposal performance than the compared models. [ABSTRACT FROM AUTHOR]
Details
- Language :
- English
- ISSN :
- 02181940
- Volume :
- 33
- Issue :
- 3
- Database :
- Complementary Index
- Journal :
- International Journal of Software Engineering & Knowledge Engineering
- Publication Type :
- Academic Journal
- Accession number :
- 162840240
- Full Text :
- https://doi.org/10.1142/S0218194022500814