TURING

execuTive fUnction aRtIficial iNtelliGence

Turing Usage

We use a TAPEX-style table flattening function as follows:

def TableFlaten(dataframe):
    output_text = ""
    data_colums = dataframe.columns
    count = len(data_colums) - 1
    processed = 0
    for columns_names in data_colums:
        if processed == 0:
            output_text += "col: " + str(columns_names) + " | "
        elif processed == count:
            output_text += str(columns_names)
        else:
            output_text += str(columns_names) + " | "
        processed += 1
    processed = 0 
    for i , data_row in dataframe.iterrows():
        row_count = len(data_row)
        for c in range(row_count):
                if c == 0:
                    output_text += " row" + str(i) + ": " + str(data_row[c])
                if c > 0:
                    output_text += " | " + str(data_row[c])
    return output_text

To infer from the model we use the following format as input:

table<user>some user input<assistant> ...generated text...

The following is an example from the dataset used to finetune TURING

col: Party | Party | Candidate | Votes | % | ± row1: - | Republican | James R. Thompson (incumbent) | 1,816,101 | 49.44 | - row2: - | Democratic | Adlai Stevenson III | 1,811,027 | 49.30 | - row3: - | Libertarian | Bea Armstrong | 24,417 | 0.66 | - row4: - | Taxpayers | John E. Roche | 22,001 | 0.60 | - row5: - | N/A | write-ins | 161 | 0.00 | n-a row6: Majority | Majority | Majority | 5,074 | 0.14 | - row7: Turnout | Turnout | Turnout | 3,673,707 | - | - row8: - | Republican hold | Republican hold | Swing | - | -<user>Who won the 1982 Illinois gubernatorial election, and how many votes was the margin?<assistant>Thompson prevailed in the 1982 Illinois gubernatorial election by a 5,074 vote margin.

Note: