[Misdetection] CSS file misdetected as C
What should the file have been detected as? What has the file been misdetected as?
Python implementation: (filedetect) agresor@darkstar:~$ magika -s /usr/share/doc/libexpat1-dev/expat.html/style.css /usr/share/doc/libexpat1-dev/expat.html/style.css: C source (code) 90%
Web demo implementation:
Please link or attach the misdetected file below (Do NOT upload PII!) style.css.gz
Additional context Seems like different implementation of the same model have different detections.
Indeed! It seems to be a bug in the feature generation in the Python library. The JS library works just fine, which indicates that this is not a model problem.
$ magika-js style.css
style.css css 0.9784206748008728
Whereas the reference python implementation is wrong.
$ magika --json style.css
[
{
"path": "style.css",
"dl": {
"ct_label": "c",
"score": 0.903327465057373,
"group": "code",
"mime_type": "text/x-c",
"magic": "C source",
"description": "C source"
},
"output": {
"ct_label": "c",
"score": 0.903327465057373,
"group": "code",
"mime_type": "text/x-c",
"magic": "C source",
"description": "C source"
}
}
]
$ magika --generate-report style.css
{"version": "0.5.0", "model_dir_name": "standard_v1", "python_version": "3.11.7 (main, Dec 8 2023, 14:22:46) [GCC 13.2.0]", "reports": [{"hash": "f406460bc73980118d8d15186daa51918d52752562641e27d19eb453c0c0817e", "features": "{\"beg\":[47,42,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,95,95,32,32,95,95,32,32,32,32,32,32,32,32,32,32,32,32,95,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,95,95,95,92,32,92,47,32,47,95,32,95,95,32,32,32,95,95,32,95,124,32,124,95,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,47,32,95,32,92,92,32,32,47,124,32,39,95,32,92,32,47,32,95,96,32,124,32,95,95,124,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,124,32,32,95,95,47,47,32,32,92,124,32,124,95,41,32,124,32,40,95,124,32,124,32,124,95,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,92,95,95,95,47,95,47,92,95,92,32,46,95,95,47,32,92,95,95,44,95,124,92,95,95,124,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,124,95,124,32,88,77,76,32,112,97,114,115,101,114,10,10,32,32,32,67,111,112,121,114,105,103,104,116,32,40,99,41,32,50,48,48,48,32,32,32,32,32,32,67,108,97,114,107,32,67,111,111,112,101,114,32,60,99,111,111,112,101,114,99,99,64,117,115,101,114,115,46,115,111,117,114,99,101,102,111,114,103,101,46,110,101,116,62,10,32,32,32,67,111,112,121,114,105,103,104,116,32,40,99,41,32,50,48,48,48,45,50,48,48,52,32,70,114,101,100,32,76,46,32,68,114,97,107,101,44,32,74,114,46,32,60,102,100,114,97,107,101,64,117,115,101,114,115,46,115,111,117,114,99,101,102,111,114,103,101,46,110,101,116,62,10,32,32,32,67,111,112,121,114,105,103,104,116,32,40,99,41,32,50,48,50,49,32,32,32,32,32,32,83,101,98,97,115,116,105,97,110,32,80,105,112,112,105,110,103,32,60,115,101,98,97,115,116,105,97,110,64,112,105,112,112],\"mid\":[119,97,114,101,34,41,44,32,32,116,111,32,32,100,101,97,108,32,105,110,32,32,116,104,101,32,32,83,111,102,116,119,97,114,101,32,32,119,105,116,104,111,117,116,32,114,101,115,116,114,105,99,116,105,111,110,44,32,32,105,110,99,108,117,100,105,110,103,10,32,32,32,119,105,116,104,111,117,116,32,32,108,105,109,105,116,97,116,105,111,110,32,116,104,101,32,32,114,105,103,104,116,115,32,32,116,111,32,117,115,101,44,32,32,99,111,112,121,44,32,32,109,111,100,105,102,121,44,32,109,101,114,103,101,44,32,32,112,117,98,108,105,115,104,44,10,32,32,32,100,105,115,116,114,105,98,117,116,101,44,32,115,117,98,108,105,99,101,110,115,101,44,32,97,110,100,47,111,114,32,115,101,108,108,32,99,111,112,105,101,115,32,111,102,32,116,104,101,32,83,111,102,116,119,97,114,101,44,32,97,110,100,32,116,111,32,112,101,114,109,105,116,10,32,32,32,112,101,114,115,111,110,115,32,32,116,111,32,119,104,111,109,32,32,116,104,101,32,83,111,102,116,119,97,114,101,32,32,105,115,32,32,102,117,114,110,105,115,104,101,100,32,116,111,32,32,100,111,32,115,111,44,32,32,115,117,98,106,101,99,116,32,116,111,32,32,116,104,101,10,32,32,32,102,111,108,108,111,119,105,110,103,32,99,111,110,100,105,116,105,111,110,115,58,10,10,32,32,32,84,104,101,32,97,98,111,118,101,32,99,111,112,121,114,105,103,104,116,32,32,110,111,116,105,99,101,32,97,110,100,32,116,104,105,115,32,112,101,114,109,105,115,115,105,111,110,32,110,111,116,105,99,101,32,32,115,104,97,108,108,32,98,101,32,105,110,99,108,117,100,101,100,10,32,32,32,105,110,32,97,108,108,32,99,111,112,105,101,115,32,111,114,32,115,117,98,115,116,97,110,116,105,97,108,32,112,111,114,116,105,111,110,115,32,111,102,32,116,104,101,32,83,111,102,116,119,97,114,101,46,10,10,32,32,32,84,72,69,32,32,83,79,70,84,87,65,82,69,32,32,73,83,32,32,80,82,79,86,73,68,69,68,32,32,34,65,83,32,32,73,83,34,44,32,32,87,73,84,72,79,85,84],\"end\":[82,83,32,79,82,32,32,67,79,80,89,82,73,71,72,84,32,72,79,76,68,69,82,83,32,66,69,32,76,73,65,66,76,69,32,70,79,82,32,65,78,89,32,67,76,65,73,77,44,10,32,32,32,68,65,77,65,71,69,83,32,79,82,32,32,79,84,72,69,82,32,76,73,65,66,73,76,73,84,89,44,32,87,72,69,84,72,69,82,32,32,73,78,32,65,78,32,32,65,67,84,73,79,78,32,79,70,32,67,79,78,84,82,65,67,84,44,32,32,84,79,82,84,32,79,82,10,32,32,32,79,84,72,69,82,87,73,83,69,44,32,65,82,73,83,73,78,71,32,70,82,79,77,44,32,79,85,84,32,79,70,32,79,82,32,73,78,32,67,79,78,78,69,67,84,73,79,78,32,87,73,84,72,32,84,72,69,32,83,79,70,84,87,65,82,69,32,79,82,32,84,72,69,10,32,32,32,85,83,69,32,79,82,32,79,84,72,69,82,32,68,69,65,76,73,78,71,83,32,73,78,32,84,72,69,32,83,79,70,84,87,65,82,69,46,10,42,47,10,10,47,42,32,83,116,111,112,32,110,111,116,32,117,115,105,110,103,32,104,97,108,102,32,116,104,101,32,115,99,114,101,101,110,32,42,47,10,98,111,100,121,32,123,10,32,32,109,97,120,45,119,105,100,116,104,58,32,110,111,110,101,59,32,47,42,32,119,97,115,58,32,56,48,99,104,32,42,47,10,125,10,10,46,99,112,112,45,115,121,109,98,111,108,115,32,100,116,32,123,10,32,32,102,111,110,116,45,102,97,109,105,108,121,58,32,109,111,110,111,115,112,97,99,101,59,10,125,10,10,47,42,32,82,101,115,101,109,98,108,101,32,115,116,121,108,101,32,111,102,32,60,102,111,111,116,101,114,62,32,119,104,105,99,104,32,105,115,32,110,111,116,32,112,97,114,116,32,111,102,32,120,104,116,109,108,49,45,115,116,114,105,99,116,32,42,47,10,46,102,111,111,116,101,114,32,123,10,32,32,102,111,110,116,45,115,105,122,101,58,32,118,97,114,40,45,45,111,107,45,102,115,45,53,41,59,10,32,32,99,111,108,111,114,58,32,118,97,114,40,45,45,111,107,45,116,99,45,49,41,59,10,125]}", "result": {"path": "<REMOVED>", "dl": {"ct_label": "c", "score": 0.903327465057373, "group": "code", "mime_type": "text/x-c", "magic": "C source", "description": "C source"}, "output": {"ct_label": "c", "score": 0.903327465057373, "group": "code", "mime_type": "text/x-c", "magic": "C source", "description": "C source"}}}]}
########################################
@reyammer (when you're back from OOO) this issue should be looked at closely