|
1522 | 1522 | " [4, 5],\n", |
1523 | 1523 | " [6, 7],\n", |
1524 | 1524 | " [8, 9]]),\n", |
1525 | | - " <text_extensions_for_pandas.array.tensor.TensorDtype at 0x7fb2e82c5d10>)" |
| 1525 | + " <text_extensions_for_pandas.array.tensor.TensorDtype at 0x7fe6a86432d0>)" |
1526 | 1526 | ] |
1527 | 1527 | }, |
1528 | 1528 | "execution_count": 22, |
|
1903 | 1903 | " <tr>\n", |
1904 | 1904 | " <th>0</th>\n", |
1905 | 1905 | " <td>[0, 2): 'In'</td>\n", |
1906 | | - " <td>[0, 1, 0, 0]</td>\n", |
| 1906 | + " <td>[0, 0, 1, 0]</td>\n", |
1907 | 1907 | " </tr>\n", |
1908 | 1908 | " <tr>\n", |
1909 | 1909 | " <th>1</th>\n", |
|
1918 | 1918 | " <tr>\n", |
1919 | 1919 | " <th>3</th>\n", |
1920 | 1920 | " <td>[11, 15): 'King'</td>\n", |
1921 | | - " <td>[0, 0, 0, 1]</td>\n", |
| 1921 | + " <td>[0, 1, 0, 0]</td>\n", |
1922 | 1922 | " </tr>\n", |
1923 | 1923 | " <tr>\n", |
1924 | 1924 | " <th>4</th>\n", |
1925 | 1925 | " <td>[16, 22): 'Arthur'</td>\n", |
1926 | | - " <td>[0, 1, 0, 0]</td>\n", |
| 1926 | + " <td>[0, 0, 1, 0]</td>\n", |
1927 | 1927 | " </tr>\n", |
1928 | 1928 | " </tbody>\n", |
1929 | 1929 | "</table>\n", |
1930 | 1930 | "</div>" |
1931 | 1931 | ], |
1932 | 1932 | "text/plain": [ |
1933 | 1933 | " span features\n", |
1934 | | - "0 [0, 2): 'In' [0, 1, 0, 0]\n", |
| 1934 | + "0 [0, 2): 'In' [0, 0, 1, 0]\n", |
1935 | 1935 | "1 [3, 5): 'AD' [0, 1, 0, 0]\n", |
1936 | 1936 | "2 [6, 9): '932' [0, 0, 0, 1]\n", |
1937 | | - "3 [11, 15): 'King' [0, 0, 0, 1]\n", |
1938 | | - "4 [16, 22): 'Arthur' [0, 1, 0, 0]" |
| 1937 | + "3 [11, 15): 'King' [0, 1, 0, 0]\n", |
| 1938 | + "4 [16, 22): 'Arthur' [0, 0, 1, 0]" |
1939 | 1939 | ] |
1940 | 1940 | }, |
1941 | 1941 | "execution_count": 32, |
|
1958 | 1958 | "# Save DataFrame to a feather file.\n", |
1959 | 1959 | "# Feather is a lightweight, fast binary columnar format, with basic\n", |
1960 | 1960 | "# compression and support built into Pandas.\n", |
1961 | | - "\n", |
1962 | | - "# TODO: Temporarily disabled while we revamp Feather support to handle multi-doc span arrays\n", |
1963 | | - "#df.to_feather(\"outputs/tp_overview.feather\")" |
| 1961 | + "df.to_feather(\"outputs/tp_overview.feather\")" |
1964 | 1962 | ] |
1965 | 1963 | }, |
1966 | 1964 | { |
1967 | 1965 | "cell_type": "code", |
1968 | 1966 | "execution_count": 34, |
1969 | 1967 | "metadata": {}, |
1970 | | - "outputs": [], |
| 1968 | + "outputs": [ |
| 1969 | + { |
| 1970 | + "data": { |
| 1971 | + "text/html": [ |
| 1972 | + "<div>\n", |
| 1973 | + "<style scoped>\n", |
| 1974 | + " .dataframe tbody tr th:only-of-type {\n", |
| 1975 | + " vertical-align: middle;\n", |
| 1976 | + " }\n", |
| 1977 | + "\n", |
| 1978 | + " .dataframe tbody tr th {\n", |
| 1979 | + " vertical-align: top;\n", |
| 1980 | + " }\n", |
| 1981 | + "\n", |
| 1982 | + " .dataframe thead th {\n", |
| 1983 | + " text-align: right;\n", |
| 1984 | + " }\n", |
| 1985 | + "</style>\n", |
| 1986 | + "<table border=\"1\" class=\"dataframe\">\n", |
| 1987 | + " <thead>\n", |
| 1988 | + " <tr style=\"text-align: right;\">\n", |
| 1989 | + " <th></th>\n", |
| 1990 | + " <th>span</th>\n", |
| 1991 | + " <th>features</th>\n", |
| 1992 | + " </tr>\n", |
| 1993 | + " </thead>\n", |
| 1994 | + " <tbody>\n", |
| 1995 | + " <tr>\n", |
| 1996 | + " <th>0</th>\n", |
| 1997 | + " <td>[0, 2): 'In'</td>\n", |
| 1998 | + " <td>[0, 0, 1, 0]</td>\n", |
| 1999 | + " </tr>\n", |
| 2000 | + " <tr>\n", |
| 2001 | + " <th>1</th>\n", |
| 2002 | + " <td>[3, 5): 'AD'</td>\n", |
| 2003 | + " <td>[0, 1, 0, 0]</td>\n", |
| 2004 | + " </tr>\n", |
| 2005 | + " <tr>\n", |
| 2006 | + " <th>2</th>\n", |
| 2007 | + " <td>[6, 9): '932'</td>\n", |
| 2008 | + " <td>[0, 0, 0, 1]</td>\n", |
| 2009 | + " </tr>\n", |
| 2010 | + " <tr>\n", |
| 2011 | + " <th>3</th>\n", |
| 2012 | + " <td>[11, 15): 'King'</td>\n", |
| 2013 | + " <td>[0, 1, 0, 0]</td>\n", |
| 2014 | + " </tr>\n", |
| 2015 | + " <tr>\n", |
| 2016 | + " <th>4</th>\n", |
| 2017 | + " <td>[16, 22): 'Arthur'</td>\n", |
| 2018 | + " <td>[0, 0, 1, 0]</td>\n", |
| 2019 | + " </tr>\n", |
| 2020 | + " </tbody>\n", |
| 2021 | + "</table>\n", |
| 2022 | + "</div>" |
| 2023 | + ], |
| 2024 | + "text/plain": [ |
| 2025 | + " span features\n", |
| 2026 | + "0 [0, 2): 'In' [0, 0, 1, 0]\n", |
| 2027 | + "1 [3, 5): 'AD' [0, 1, 0, 0]\n", |
| 2028 | + "2 [6, 9): '932' [0, 0, 0, 1]\n", |
| 2029 | + "3 [11, 15): 'King' [0, 1, 0, 0]\n", |
| 2030 | + "4 [16, 22): 'Arthur' [0, 0, 1, 0]" |
| 2031 | + ] |
| 2032 | + }, |
| 2033 | + "execution_count": 34, |
| 2034 | + "metadata": {}, |
| 2035 | + "output_type": "execute_result" |
| 2036 | + } |
| 2037 | + ], |
1971 | 2038 | "source": [ |
1972 | 2039 | "# Read the file back into a new DataFrame.\n", |
1973 | 2040 | "\n", |
1974 | | - "# TODO: Temporarily disabled while we revamp Feather support to handle multi-doc span arrays\n", |
1975 | | - "#df_load = pd.read_feather(\"outputs/tp_overview.feather\")\n", |
1976 | | - "#df_load.head()" |
| 2041 | + "df_load = pd.read_feather(\"outputs/tp_overview.feather\")\n", |
| 2042 | + "df_load.head()" |
1977 | 2043 | ] |
1978 | 2044 | }, |
1979 | 2045 | { |
|
0 commit comments