Polars overkill show all rows-cols decorator
Overkill and suboptimal but good enough and makes my jupyter stuff more pleasant
class DDecorator(ContextDecorator):
"""To use:
DD = DDecorator()
with DD:
your pl stuff with shown cols rows
# or
DD(your_df) -> display(your_df)
"""
def __init__(self, ncols=-1, nrows=-1):
self.ncols = ncols
self.nrows = nrows
def_state = pl.Config.state()
# print(def_state)
self.d_ncols = def_state["POLARS_FMT_MAX_COLS"]
self.d_nrows = def_state["POLARS_FMT_MAX_ROWS"]
def __call__(self, df, all: bool = False, ncols=None, nrows=None):
ncols = self.ncols if ncols is None else ncols
nrows = self.nrows if nrows is None else nrows
if all:
ncols = -1
nrows = -1
with pl.Config(set_tbl_cols=ncols, set_tbl_rows=nrows):
display(df)
def __enter__(self):
pl.Config.set_tbl_rows(self.nrows)
pl.Config.set_tbl_cols(self.ncols)
return self
def __exit__(self, *exc):
# print("Finishing")
# default vals
pl.Config.set_tbl_rows(self.d_nrows)
pl.Config.set_tbl_cols(self.d_ncols)
return False
DD = DDecorator(nrows=30, ncols=30)
def describe(df):
# with DDecorator(ncols=-1):
with pl.Config(set_tbl_cols=-1):
itables.show(
df.describe(percentiles=None), fixedColumns={"start": 1}, scrollX=True
)
(Preserving l/r width)
(h6_en is lm-eval)
and adding blocks — much less chaotic than 3d slicer (at first glance)
(EDIT: oh damn it’s 7, not 6!)
from the paper
+
- … leading to a probability not of 1/4(..10) but 1/2
- one way to filter out such bad examples is to get a LM to solve the task without providing context, or even better - look at the distribution of probabilities over the answers and see if some are MUCH more likely than the others
- Issue with 2-3-4 plurals: I can just create three classes of nouns, singular, 2-3-4, and >=5
- don’t forget to discuss the morphology complexities in the masterarbeit
- Conveying the issues in English is hard, but I can (for a given UA example)
- provide the morphology info for the English words
- provide a third German translation
G
(<
(same paper)
(pic from <
j
{:height=“500px”}
{:height=“500px”}.
{:width=“50%”}.
{:height=“500px”}.
{:height=“500px”}.
{:height=“500px”}.
{:height=“500px”}
{:height=“500px”}.
{:height=“500px”}.
{:height=“300px”}.
{:height=“300px”}.
{:height=“300px”}.