CoolFace
Apppublic

Sahil1694/Atlan

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
precompute_classifications.cpython-311.pyc11 linesDownload Raw Back to __pycache__
1�

2G>�h��V�ddlZddlZddlZddlmZddlmZdZdZedk�r�e	d��	e3edd	�4��5Zeje��Z
ddd��n#1swxYwYe	dee
���de�d
���nH#e$re	de�d���e��Yn(ej$re	de�d
���e��YnwxYwgZee
d���D]cZe�d��Zes�ee��Ze���Zeed<e�e��ejd���d	e5edd	�6��5Zejeed���ddd��n#1swxYwYe	de�d
���dS#e$rZe	de����YdZ[dSdZ[wwxYwdS)�N)�tqdm)�classify_ticketzdata/sample_tickets.jsonzdata/classified_tickets.json�__main__uI🚀 Starting Ticket Classification Process (with rate limit handling)...�rzutf-8)�encodingu✅ Successfully loaded z tickets from 'z'.u🚨 Error: Input file 'z' not found.u(🚨 Error: Could not decode JSON from 'zClassifying Tickets)�desc�body�classification��w)�indentuB7✨ Process complete. All classified tickets have been saved to 'u.8🚨 Error: Could not write results. Reason: )�os�json�timer�pipeline.classifierr�INPUT_FILENAME�OUTPUT_FILENAME�__name__�print�open�f�load�all_tickets�len�FileNotFoundError�exit�JSONDecodeError�classification_results�ticket�get�ticket_body�result�copy�classified_ticket�append�sleep�dump�	Exception�e���[C:\Users\Sahil\OneDrive\Desktop\Atlan Project\backend\scripts\precompute_classifications.py�<module>r-s=��	�	�	�	���������������/�/�/�/�/�/�,��0���z���	�E�9U�V�V�V�	�
�T�.�#��
8�
8�
8�	'�A�#�$�)�A�,�,�K�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�
��\���[�)9�)9�\�\�.�\�\�\�]�]�]�]������
��E��E�E�E�F�F�F�������������
��K��K�K�K�L�L�L������������10 ���$�{�)>�?�?�?�����j�j��(�(���	��!���-�-��#�K�K�M�M��.4��*�+��%�%�&7�8�8�8�	��11�1�
�
�
�
�E�
�T�/�3��
9�
9�
9�	;�Q��D�I�,�a��:�:�:�:�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;����	;�	;�	;�	;�
��g�Tc�g�g�g�h�h�h�h�h���E�E�E�
��C��C�C�D�D�D�D�D�D�D�D�D�����E����Q�sv�B�A�B�A�B�"A�#B�C�""C�C�>F�E,� F�,E0�0F�3E0�4F�F&�
F!�!F&