Spaces:
Sleeping
Sleeping
wlmbrown
commited on
Commit
·
2152de4
1
Parent(s):
ade27c2
Add logic for Article 50 in function called check_article_50
Browse files- project_cc.yaml +54 -16
- utils.py +20 -2
project_cc.yaml
CHANGED
@@ -42,8 +42,6 @@ gpai_model:
|
|
42 |
|
43 |
# Information related to whether or not the project, if an AI system, is a high-risk AI system
|
44 |
|
45 |
-
# TODO Unbundle the use cases mentioned in Annex I
|
46 |
-
|
47 |
high_risk_ai_system:
|
48 |
safety_component_machinery:
|
49 |
article: 'Art. 6(1); ANNEX I(A)(1)'
|
@@ -201,11 +199,11 @@ gpai_model_systemic_risk:
|
|
201 |
# Information related to the Act's exceptions for scientific research, open-source AI, and more
|
202 |
|
203 |
excepted:
|
204 |
-
military:
|
205 |
article: 'Art. 2(3)'
|
206 |
verbose: 'AI project is placed on the market, put into service, or used with or without modification exclusively for military, defence or national security purposes'
|
207 |
value: !!bool false
|
208 |
-
military_use:
|
209 |
article: 'Art. 2(3)'
|
210 |
verbose: 'AI project is not placed on the market or put into service in the Union, but the output is used in the Union exclusively for military, defence or national security purposes, regardless of the type of entity carrying out those activities.'
|
211 |
value: !!bool false
|
@@ -441,7 +439,7 @@ transparency_and_provision_of_information_to_deployers:
|
|
441 |
value: !!bool false
|
442 |
compliance:
|
443 |
article: 'Art. 13(1)'
|
444 |
-
verbose: 'AI project is designed and developed with transparency to ensure compliance with provider and deployer obligations in
|
445 |
value: !!bool false
|
446 |
instructions:
|
447 |
article: 'Art. 13(2)'
|
@@ -775,7 +773,7 @@ gpai_models_with_systemic_risk_obligations:
|
|
775 |
verbose: 'The provider has drawn up and will keep up-to-date technical documentation of the model that includes, where applicable, a detailed description of the system architecture explaining how software components build or feed into each other and integrate into the overall processing.'
|
776 |
value: !!bool false
|
777 |
|
778 |
-
|
779 |
ai_literacy:
|
780 |
article: 'Article 4'
|
781 |
verbose: ''
|
@@ -807,21 +805,19 @@ additional_provider_obligations:
|
|
807 |
|
808 |
# Information related to the additional transparency requirements in Article 50, if applicable
|
809 |
|
810 |
-
|
811 |
-
|
812 |
-
transparency_related:
|
813 |
direct_user_interaction:
|
814 |
-
article: 'Art. 50'
|
815 |
verbose: 'The AI project is intended to interact directly with natural persons'
|
816 |
value: !!bool false
|
817 |
exception_obvious:
|
818 |
-
article: 'Art. 50'
|
819 |
verbose: 'When interacting with the AI project, it would be obvious from the point of view of a natural person who is reasonably well-informed, observant and circumspect, taking into account the circumstances and the context of use that they are interacting with AI'
|
820 |
exception_law:
|
821 |
-
article: 'Art. 50'
|
822 |
verbose: 'The AI project is authorised by law to detect, prevent, investigate or prosecute criminal offences, subject to appropriate safeguards for the rights and freedoms of third parties, and is not available for the public to report a criminal offence'
|
823 |
value: !!bool false
|
824 |
-
|
825 |
article: 'Art. 50(2)'
|
826 |
verbose: 'The AI project generates synthetic audio, image, video or text content'
|
827 |
value: !!bool false
|
@@ -829,15 +825,57 @@ transparency_related:
|
|
829 |
article: 'Art. 50(2)'
|
830 |
verbose: 'The AI project performs an assistive function for standard editing'
|
831 |
value: !!bool false
|
832 |
-
|
833 |
article: 'Art. 50(2)'
|
834 |
verbose: 'The AI project does not substantially alter the input data provided by the deployer or the semantics thereof, or where authorised by law to detect, prevent, investigate or prosecute criminal offences.'
|
835 |
value: !!bool false
|
836 |
emotion_reconition:
|
837 |
-
article: 'Art. 50(
|
838 |
verbose: 'The AI project is an emotion recognition system'
|
839 |
value: !!bool false
|
840 |
biometric_categorization:
|
841 |
-
article: 'Art. 50(
|
842 |
verbose: 'The AI project is a biometric categorisation system'
|
843 |
value: !!bool false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
# Information related to whether or not the project, if an AI system, is a high-risk AI system
|
44 |
|
|
|
|
|
45 |
high_risk_ai_system:
|
46 |
safety_component_machinery:
|
47 |
article: 'Art. 6(1); ANNEX I(A)(1)'
|
|
|
199 |
# Information related to the Act's exceptions for scientific research, open-source AI, and more
|
200 |
|
201 |
excepted:
|
202 |
+
military:
|
203 |
article: 'Art. 2(3)'
|
204 |
verbose: 'AI project is placed on the market, put into service, or used with or without modification exclusively for military, defence or national security purposes'
|
205 |
value: !!bool false
|
206 |
+
military_use:
|
207 |
article: 'Art. 2(3)'
|
208 |
verbose: 'AI project is not placed on the market or put into service in the Union, but the output is used in the Union exclusively for military, defence or national security purposes, regardless of the type of entity carrying out those activities.'
|
209 |
value: !!bool false
|
|
|
439 |
value: !!bool false
|
440 |
compliance:
|
441 |
article: 'Art. 13(1)'
|
442 |
+
verbose: 'AI project is designed and developed with transparency to ensure compliance with provider and deployer obligations in the Act'
|
443 |
value: !!bool false
|
444 |
instructions:
|
445 |
article: 'Art. 13(2)'
|
|
|
773 |
verbose: 'The provider has drawn up and will keep up-to-date technical documentation of the model that includes, where applicable, a detailed description of the system architecture explaining how software components build or feed into each other and integrate into the overall processing.'
|
774 |
value: !!bool false
|
775 |
|
776 |
+
ai_systems_obligations:
|
777 |
ai_literacy:
|
778 |
article: 'Article 4'
|
779 |
verbose: ''
|
|
|
805 |
|
806 |
# Information related to the additional transparency requirements in Article 50, if applicable
|
807 |
|
808 |
+
article_50:
|
|
|
|
|
809 |
direct_user_interaction:
|
810 |
+
article: 'Art. 50(1)'
|
811 |
verbose: 'The AI project is intended to interact directly with natural persons'
|
812 |
value: !!bool false
|
813 |
exception_obvious:
|
814 |
+
article: 'Art. 50(1)'
|
815 |
verbose: 'When interacting with the AI project, it would be obvious from the point of view of a natural person who is reasonably well-informed, observant and circumspect, taking into account the circumstances and the context of use that they are interacting with AI'
|
816 |
exception_law:
|
817 |
+
article: 'Art. 50(1)'
|
818 |
verbose: 'The AI project is authorised by law to detect, prevent, investigate or prosecute criminal offences, subject to appropriate safeguards for the rights and freedoms of third parties, and is not available for the public to report a criminal offence'
|
819 |
value: !!bool false
|
820 |
+
synthetic_content:
|
821 |
article: 'Art. 50(2)'
|
822 |
verbose: 'The AI project generates synthetic audio, image, video or text content'
|
823 |
value: !!bool false
|
|
|
825 |
article: 'Art. 50(2)'
|
826 |
verbose: 'The AI project performs an assistive function for standard editing'
|
827 |
value: !!bool false
|
828 |
+
exception_insubstantial:
|
829 |
article: 'Art. 50(2)'
|
830 |
verbose: 'The AI project does not substantially alter the input data provided by the deployer or the semantics thereof, or where authorised by law to detect, prevent, investigate or prosecute criminal offences.'
|
831 |
value: !!bool false
|
832 |
emotion_reconition:
|
833 |
+
article: 'Art. 50(3)'
|
834 |
verbose: 'The AI project is an emotion recognition system'
|
835 |
value: !!bool false
|
836 |
biometric_categorization:
|
837 |
+
article: 'Art. 50(3)'
|
838 |
verbose: 'The AI project is a biometric categorisation system'
|
839 |
value: !!bool false
|
840 |
+
emotion_reconition_law:
|
841 |
+
article: 'Art. 50(3)'
|
842 |
+
verbose: 'The AI project is an emotion recognition system permitted by law to detect, prevent or investigate criminal offences, subject to appropriate safeguards for the rights and freedoms of third parties, and in accordance with Union law.'
|
843 |
+
value: !!bool false
|
844 |
+
biometric_categorization_law:
|
845 |
+
article: 'Art. 50(3)'
|
846 |
+
verbose: 'The AI project is a biometric categorisation system permitted by law to detect, prevent or investigate criminal offences, subject to appropriate safeguards for the rights and freedoms of third parties, and in accordance with Union law.'
|
847 |
+
value: !!bool false
|
848 |
+
deepfake_non_art:
|
849 |
+
article: 'Art. 50(4)'
|
850 |
+
verbose: 'AI project generates or manipulates image, audio or video content constituting a deep fake and the content does not form part of an evidently artistic, creative, satirical, fictional or analogous work or programme.'
|
851 |
+
value: !!bool false
|
852 |
+
deepfake_law:
|
853 |
+
article: 'Art. 50(4)'
|
854 |
+
verbose: 'AI project is authorised by law to detect, prevent, investigate or prosecute criminal offence.'
|
855 |
+
value: !!bool false
|
856 |
+
deepfake_art:
|
857 |
+
article: 'Art. 50(4)'
|
858 |
+
verbose: 'AI project generates or manipulates image, audio or video content constituting a deep fake but the content forms part of an evidently artistic, creative, satirical, fictional or analogous work or programme.'
|
859 |
+
value: !!bool false
|
860 |
+
|
861 |
+
article_50_obligations:
|
862 |
+
informed_ai:
|
863 |
+
article: 'Art. 50(1)'
|
864 |
+
verbose: 'AI project is designed and developed in such a way that the natural persons concerned are informed that they are interacting with an AI system.'
|
865 |
+
value: !!bool false
|
866 |
+
marked:
|
867 |
+
article: 'Art. 50(2)'
|
868 |
+
verbose: 'The outputs of the AI project are marked in a machine-readable format and detectable as artificially generated or manipulated.'
|
869 |
+
value: !!bool false
|
870 |
+
informed_biometric:
|
871 |
+
article: 'Art. 50(2)'
|
872 |
+
verbose: 'The AI project informs the natural persons exposed thereto of the operation of the system, and processes the personal data in accordance with Regulations (EU) 2016/679 and (EU) 2018/1725 and Directive (EU) 2016/680, as applicable.'
|
873 |
+
value: !!bool false
|
874 |
+
deepfake_disclosure_non_art:
|
875 |
+
article: 'Art. 50(4)'
|
876 |
+
verbose: 'AI project disclose that the content has been artificially generated or manipulated.'
|
877 |
+
value: !!bool false
|
878 |
+
deepfake_disclosure_art:
|
879 |
+
article: 'Art. 50(4)'
|
880 |
+
verbose: 'AI project discloses that the content has been artificially generated or manipulated in an appropriate manner that does not hamper the display or enjoyment of the work.'
|
881 |
+
value: !!bool false
|
utils.py
CHANGED
@@ -54,7 +54,9 @@ def check_within_scope_act(dispositive_variables, project_cc_yaml):
|
|
54 |
|
55 |
def check_excepted(dispositive_variables, project_cc_yaml):
|
56 |
|
57 |
-
if (project_cc_yaml['excepted']['
|
|
|
|
|
58 |
project_cc_yaml['excepted']['pre_market']['value'] or
|
59 |
(project_cc_yaml['ai_system']['ai_system']['value'] == True and
|
60 |
project_cc_yaml['excepted']['open_source_ai_model']['value'] == True) or
|
@@ -88,4 +90,20 @@ def check_prohibited(project_cc_yaml):
|
|
88 |
else:
|
89 |
print("You are not engaged in any prohibited practices.")
|
90 |
return False
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
def check_excepted(dispositive_variables, project_cc_yaml):
|
56 |
|
57 |
+
if (project_cc_yaml['ai_system']['ai_system']['value'] == True and project_cc_yaml['excepted']['military']['value']) or
|
58 |
+
(project_cc_yaml['ai_system']['ai_system']['value'] == True and project_cc_yaml['excepted']['military_use']['value']) or
|
59 |
+
project_cc_yaml['excepted']['scientific']['value'] or
|
60 |
project_cc_yaml['excepted']['pre_market']['value'] or
|
61 |
(project_cc_yaml['ai_system']['ai_system']['value'] == True and
|
62 |
project_cc_yaml['excepted']['open_source_ai_model']['value'] == True) or
|
|
|
90 |
else:
|
91 |
print("You are not engaged in any prohibited practices.")
|
92 |
return False
|
93 |
+
|
94 |
+
def check_article_50():
|
95 |
+
If (project_cc_yaml['article_50']['direct_user_interaction'] == True and project_cc_yaml['article_50']['exception_obvious'] == False and project_cc_yaml['article_50']['exception_law'] == False) and project_cc_yaml['article_50_obligations']['notice'] == False:
|
96 |
+
print("You are not are not compliance with Article 50(1).")
|
97 |
+
return False
|
98 |
+
|
99 |
+
If (project_cc_yaml['article_50']['synthetic_content'] == True and project_cc_yaml['article_50']['exception_assistive'] == False and project_cc_yaml['article_50']['exception_insubstantial'] == False) and project_cc_yaml['article_50_obligations']['marked'] == False:
|
100 |
+
print("You are not are not compliance with Article 50(2).")
|
101 |
+
return False
|
102 |
+
|
103 |
+
If (((project_cc_yaml['article_50']['emotion_reconition'] == True and project_cc_yaml['article_50']['emotion_reconition_law'] == False) or (project_cc_yaml['article_50']['biometric_categorization'] == True and project_cc_yaml['article_50']['biometric_categorization'] == False))) and project_cc_yaml['article_50_obligations']['informed_biometric'] == False:
|
104 |
+
print("You are not are not compliance with Article 50(3).")
|
105 |
+
return False
|
106 |
+
|
107 |
+
If ((project_cc_yaml['article_50']['deepfake_not_art'] == True and project_cc_yaml['article_50']['deepfake_law'] == False and ['article_50_obligations']['deepfake_disclosure'] == False) or (project_cc_yaml['article_50']['deepfake_art'] == True and project_cc_yaml['article_50']['deepfake_law'] == False and project_cc_yaml['article_50_obligations']['deepfake_disclosure_art'] == False)):
|
108 |
+
print("You are not are not compliance with Article 50(4).")
|
109 |
+
return False
|