@@ -320,45 +320,42 @@ def empty_radio_prediction():
320320
321321@pytest .fixture
322322def matching_checklist ():
323- return NameSpace (
324- labels = [],
325- classifications = [{
326- 'featureId' :
327- '1234567890111213141516171' ,
328- 'schemaId' :
329- 'ckppid25v0000aeyjmxfwlc7t' ,
330- 'uuid' :
331- '76e0dcea-fe46-43e5-95f5-a5e3f378520a' ,
332- 'schemaId' :
333- 'ckppid25v0000aeyjmxfwlc7t' ,
334- 'answers' : [{
335- 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
336- }, {
337- 'schemaId' : 'ckppide010001aeyj0yhiaghc'
338- }, {
339- 'schemaId' : 'ckppidq4u0002aeyjmcc4toxw'
340- }]
341- }],
342- predictions = [{
343- 'uuid' :
344- '76e0dcea-fe46-43e5-95f5-a5e3f378520a' ,
345- 'schemaId' :
346- 'ckppid25v0000aeyjmxfwlc7t' ,
347- 'dataRow' : {
348- 'id' : 'ckppihxc10005aeyjen11h7jh'
349- },
350- 'answers' : [{
351- 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
352- }, {
353- 'schemaId' : 'ckppide010001aeyj0yhiaghc'
354- }, {
355- 'schemaId' : 'ckppidq4u0002aeyjmcc4toxw'
356- }]
357- }],
358- data_row_expected = 1. ,
359- # expected = [1.]
360- # expected=[1., 1., 1.])
361- expected = {1.0 : 3 })
323+ return NameSpace (labels = [],
324+ classifications = [{
325+ 'featureId' :
326+ '1234567890111213141516171' ,
327+ 'schemaId' :
328+ 'ckppid25v0000aeyjmxfwlc7t' ,
329+ 'uuid' :
330+ '76e0dcea-fe46-43e5-95f5-a5e3f378520a' ,
331+ 'schemaId' :
332+ 'ckppid25v0000aeyjmxfwlc7t' ,
333+ 'answers' : [{
334+ 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
335+ }, {
336+ 'schemaId' : 'ckppide010001aeyj0yhiaghc'
337+ }, {
338+ 'schemaId' : 'ckppidq4u0002aeyjmcc4toxw'
339+ }]
340+ }],
341+ predictions = [{
342+ 'uuid' :
343+ '76e0dcea-fe46-43e5-95f5-a5e3f378520a' ,
344+ 'schemaId' :
345+ 'ckppid25v0000aeyjmxfwlc7t' ,
346+ 'dataRow' : {
347+ 'id' : 'ckppihxc10005aeyjen11h7jh'
348+ },
349+ 'answers' : [{
350+ 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
351+ }, {
352+ 'schemaId' : 'ckppide010001aeyj0yhiaghc'
353+ }, {
354+ 'schemaId' : 'ckppidq4u0002aeyjmcc4toxw'
355+ }]
356+ }],
357+ data_row_expected = 1. ,
358+ expected = {1.0 : 3 })
362359
363360
364361@pytest .fixture
@@ -699,3 +696,84 @@ def point_pair():
699696 }
700697 }],
701698 expected = 0.879113232477017 )
699+
700+
701+ @pytest .fixture
702+ def matching_ner ():
703+ return NameSpace (labels = [{
704+ 'featureId' : 'ckppivl7p0006aeyj92cezr9d' ,
705+ 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
706+ 'format' : "text.location" ,
707+ 'data' : {
708+ "location" : {
709+ "start" : 0 ,
710+ "end" : 10
711+ }
712+ }
713+ }],
714+ predictions = [{
715+ 'dataRow' : {
716+ 'id' : 'ckppihxc10005aeyjen11h7jh'
717+ },
718+ 'uuid' : '76e0dcea-fe46-43e5-95f5-a5e3f378520a' ,
719+ 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
720+ "location" : {
721+ "start" : 0 ,
722+ "end" : 10
723+ }
724+ }],
725+ expected = 1 )
726+
727+
728+ @pytest .fixture
729+ def no_matching_ner ():
730+ return NameSpace (labels = [{
731+ 'featureId' : 'ckppivl7p0006aeyj92cezr9d' ,
732+ 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
733+ 'format' : "text.location" ,
734+ 'data' : {
735+ "location" : {
736+ "start" : 0 ,
737+ "end" : 5
738+ }
739+ }
740+ }],
741+ predictions = [{
742+ 'dataRow' : {
743+ 'id' : 'ckppihxc10005aeyjen11h7jh'
744+ },
745+ 'uuid' : '76e0dcea-fe46-43e5-95f5-a5e3f378520a' ,
746+ 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
747+ "location" : {
748+ "start" : 5 ,
749+ "end" : 10
750+ }
751+ }],
752+ expected = 0 )
753+
754+
755+ @pytest .fixture
756+ def partial_matching_ner ():
757+ return NameSpace (labels = [{
758+ 'featureId' : 'ckppivl7p0006aeyj92cezr9d' ,
759+ 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
760+ 'format' : "text.location" ,
761+ 'data' : {
762+ "location" : {
763+ "start" : 0 ,
764+ "end" : 7
765+ }
766+ }
767+ }],
768+ predictions = [{
769+ 'dataRow' : {
770+ 'id' : 'ckppihxc10005aeyjen11h7jh'
771+ },
772+ 'uuid' : '76e0dcea-fe46-43e5-95f5-a5e3f378520a' ,
773+ 'schemaId' : 'ckppid25v0000aeyjmxfwlc7t' ,
774+ "location" : {
775+ "start" : 3 ,
776+ "end" : 5
777+ }
778+ }],
779+ expected = 0.2857142857142857 )
0 commit comments