I have this type of log file:
[2022-01-01 00:01:08,111][train][info] - {"epoch":99, "data_loss":"111.013", "data_ntokens":"123.672"," data_nsentences":"2", "data_nll_loss":"2.01"}
[2022-01-01 00:01:08,111][train][info] - {"epoch":100, "data_loss":"111.01", "data_ntokens":"123.672"," data_nsentences":"2", "data_nll_loss":"2.901"}
[2022-01-01 00:01:08,111][train][info] - {"epoch":102, "data_loss":"222.09", "data_ntokens":"123.600"," data_nsentences":"2", "data_nll_loss":"2.1"}
I would like to get information inside the brackets, but the results' length is variable and I can not work with strings.
The dataframe that I try to get looks like this:
+-----------------------------------------------------------------------+
| epoch | data_loss | data_ntokens | data_nsentences | data_nll_notkens |
+-----------------------------------------------------------------------+
| 99 | 111.013 | 123.672 | 2 | 2.01 |
.....