├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── data └── TimelineQA │ ├── dense-100 │ ├── .gitattributes │ ├── annual_medical_care-log.csv │ ├── config.ini │ ├── create_db.sql │ ├── daily_chat-log.csv │ ├── daily_exercise-log.csv │ ├── daily_meal-log.csv │ ├── daily_read-log.csv │ ├── daily_watchtv-log.csv │ ├── marriages-log.csv │ ├── monthly_pet_care-log.csv │ ├── moves-log.csv │ ├── timeline-dense.csv │ ├── timeline.json │ ├── timeline.pkl │ ├── travel-log.csv │ ├── travel_dining-log.csv │ ├── travel_places_visited-log.csv │ ├── views_db.sqlite │ ├── views_idx.csv │ ├── views_metadata.txt │ ├── weekly_bakeorcook-log.csv │ ├── weekly_dating-log.csv │ ├── weekly_grocery-log.csv │ └── weekly_hobby-log.csv │ ├── medium-100 │ ├── .gitattributes │ ├── annual_medical_care-log.csv │ ├── config.ini │ ├── create_db.sql │ ├── daily_chat-log.csv │ ├── daily_exercise-log.csv │ ├── daily_meal-log.csv │ ├── daily_read-log.csv │ ├── daily_watchtv-log.csv │ ├── marriages-log.csv │ ├── monthly_pet_care-log.csv │ ├── moves-log.csv │ ├── timeline-medium.csv │ ├── timeline.json │ ├── timeline.pkl │ ├── travel-log.csv │ ├── travel_dining-log.csv │ ├── travel_places_visited-log.csv │ ├── views_db.sqlite │ ├── views_idx.csv │ ├── views_metadata.txt │ ├── weekly_bakeorcook-log.csv │ ├── weekly_dating-log.csv │ ├── weekly_grocery-log.csv │ └── weekly_hobby-log.csv │ └── sparse-100 │ ├── annual_medical_care-log.csv │ ├── config.ini │ ├── create_db.sql │ ├── daily_chat-log.csv │ ├── daily_exercise-log.csv │ ├── daily_meal-log.csv │ ├── daily_read-log.csv │ ├── daily_watchtv-log.csv │ ├── marriages-log.csv │ ├── monthly_pet_care-log.csv │ ├── moves-log.csv │ ├── timeline.csv.txt │ ├── timeline.json │ ├── timeline.pkl │ ├── timelinedb_sparse.sqlite │ ├── travel-log.csv │ ├── travel_dining-log.csv │ ├── travel_places_visited-log.csv │ ├── views_db.sqlite │ ├── views_idx.csv │ ├── views_metadata.txt │ ├── weekly_bakeorcook-log.csv │ ├── weekly_dating-log.csv │ ├── weekly_grocery-log.csv │ └── weekly_hobby-log.csv ├── frontend ├── README.md ├── package.json ├── public │ ├── index.html │ └── manifest.json └── src │ ├── App.js │ ├── index.css │ └── index.js ├── requirements.txt ├── server.py ├── src ├── posttext.py ├── retrieval_qa.py ├── views_qa.py └── views_util.py └── util ├── create_metadata_idx.py ├── date_cleaner.py ├── dd_cleaner.py ├── digital_data2vectorstore.py └── jsontimeline2csv.py /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to make participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies within all project spaces, and it also applies when 49 | an individual is representing the project or its community in public spaces. 50 | Examples of representing a project or community include using an official 51 | project e-mail address, posting via an official social media account, or acting 52 | as an appointed representative at an online or offline event. Representation of 53 | a project may be further defined and clarified by project maintainers. 54 | 55 | This Code of Conduct also applies outside the project spaces when there is a 56 | reasonable belief that an individual's behavior may have a negative impact on 57 | the project or its community. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported by contacting the project team at . All 63 | complaints will be reviewed and investigated and will result in a response that 64 | is deemed necessary and appropriate to the circumstances. The project team is 65 | obligated to maintain confidentiality with regard to the reporter of an incident. 66 | Further details of specific enforcement policies may be posted separately. 67 | 68 | Project maintainers who do not follow or enforce the Code of Conduct in good 69 | faith may face temporary or permanent repercussions as determined by other 70 | members of the project's leadership. 71 | 72 | ## Attribution 73 | 74 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 75 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 76 | 77 | [homepage]: https://www.contributor-covenant.org 78 | 79 | For answers to common questions about this code of conduct, see 80 | https://www.contributor-covenant.org/faq 81 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to PostText 2 | We want to make contributing to this project as easy and transparent as 3 | possible. 4 | 5 | ## Pull Requests 6 | We actively welcome your pull requests. 7 | 8 | 1. Fork the repo and create your branch from `main`. 9 | 2. If you've added code that should be tested, add tests. 10 | 3. If you've changed APIs, update the documentation. 11 | 4. Ensure the test suite passes. 12 | 5. Make sure your code lints. 13 | 6. If you haven't already, complete the Contributor License Agreement ("CLA"). 14 | 15 | ## Contributor License Agreement ("CLA") 16 | In order to accept your pull request, we need you to submit a CLA. You only need 17 | to do this once to work on any of Facebook's open source projects. 18 | 19 | Complete your CLA here: 20 | 21 | ## Issues 22 | We use GitHub issues to track public bugs. Please ensure your description is 23 | clear and has sufficient instructions to be able to reproduce the issue. 24 | 25 | Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe 26 | disclosure of security bugs. In those cases, please go through the process 27 | outlined on that page and do not file a public issue. 28 | 29 | ## License 30 | By contributing to PostText, you agree that your contributions will be licensed 31 | under the LICENSE file in the root directory of this source tree. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PostText 2 | 3 | PostText is a QA system for querying your text data. When appropriate structured views are in place, PostText is good at answering queries that require computing aggregates over your data, such as "*How many times did I exercise last month?*". In this implementation, PostText will always generate two answers, one through a view-based QA engine and the other through a retrieval-based QA engine. 4 | 5 | PostText Reference --- [https://arxiv.org/abs/2306.01061](https://arxiv.org/abs/2306.01061): 6 | ``` 7 | @article{tan2023posttext, 8 | title={Reimagining Retrieval Augmented Language Models for Answering Queries}, 9 | author={Wang-Chiew Tan and Yuliang Li and Pedro Rodriguez and Richard James and Xi Victoria Lin and Alon Halevy and Scott Yih}, 10 | journal={arXiv preprint:2306.01061}, 11 | year={2023}, 12 | } 13 | ``` 14 | 15 | To run posttext, first set up the environment and the relevant files. There are 3 datasets, sparse-100, medium-100, dense-100 already set up in this repo under the subdirectory data/TimelineQA. 16 | 17 | TimelineQA Reference --- [https://arxiv.org/abs/2306.01069](https://arxiv.org/abs/2306.01069): 18 | ``` 19 | @article{tan2023timelineqa, 20 | title={TimelineQA: A Benchmark for Question Answering over Timelines}, 21 | author={Wang-Chiew Tan and Jane Dwivedi-Yu and Yuliang Li and Lambert Mathias and Marzieh Saeidi and Jing Nathan Yan and Alon Y. Halevy}, 22 | journal={arXiv preprint:2306.01069}, 23 | year={2023} 24 | } 25 | ``` 26 | 27 | 28 | ## Setting up your environment 29 | 30 | Create and activate a new conda env: 31 | ``` 32 | conda create -n posttext python=3.10 33 | conda activate posttext 34 | ``` 35 | 36 | Install python packages (for backend): 37 | ``` 38 | conda install --file requirements.txt 39 | ``` 40 | 41 | ## Setting up your view-based QA engine 42 | 43 | ### Prepare your dataset for querying: 44 | 45 | At present, PostText's view-based QA engine is implemented on top of SQLite. Hence, to prepare your dataset for querying by the view-based QA engine, you will need to first create views, as tables in csv format. For example, if you anticipate that there will be frequent queries about your cooking, you can create a view that keeps only information related to your cooking. Once you have created these views, you can continue with the following steps to prep your views for use by the view-based QA system. 46 | 47 | 48 | 1. Create a config.ini file. An example can be found in the data/TimelineQA/sparse-100/config.ini. The best way is to get started is to copy this file to your data directory and modify it as appropriate. You can leave most of the specifications unchanged especially if you have access to OpenAI models. As you go through the remaining steps, make sure the paths to the files specified in the [input] section are correct. 49 | Alternatively, if you wish to create config.ini file from scratch, you can make use of create_config_file.py as follows: 50 | 51 | ``` 52 | python util/create_config_file.py 53 | ``` 54 | 55 | 2. Create a metadata file to describe your views. This information will be utilized by the LLM to understand which is the best view to use and how to query over it using SQLite. For example, the description of views for TimelineQA dataset is described in TimelineQA/sparse-100/views_metadata.txt 56 | 57 | After you have completed the description, specify the path of your description file in config.ini under [input] --> "views_metadata.txt". 58 | 59 | 3. Create an index of your metadata file. To do this, execute the following command. The file create_metadata_idx.py is in the util subdirectory. Note that you will need your config.ini file for this step. 60 | 61 | ``` 62 | python util/create_metadata_idx.py 63 | ``` 64 | 65 | For example: 66 | 67 | ``` 68 | python util/create_metadata_idx.py views_metadata.txt config.ini views_idx.csv 69 | ``` 70 | 71 | This command will create the file views_idx.csv. Make sure the path under [input] in config.ini points the to right path of this file. 72 | 73 | 3. Handling dates in SQLite. Before you create the views db file in sqlite, ensure that your dates are in YYYY/MM/DD format for comparisons in SQLite to work correctly. You can make use of date_cleaner.py in util folder to format the dates correctly. 74 | e.g., if your date format is in MM/DD/YYYY under a column called "date" in your , you can execute: 75 | 76 | ``` 77 | python date_cleaner.py date date 78 | ``` 79 | 80 | to convert the date column into YYYY/MM/DD and the new column will also be called "date". The file dd_cleaner.py in util also allows you to remove some columns or format dates with time concatenated in them. 81 | 82 | 4. Next, copy and modify the script "create_db.sql" (from TimelineQA/sparse-100/create_db.sql) to import the views in csv to SQLite. 83 | You will need to specify the schema before you execute import statements in create_db.sql. Note that the attributes specified in create_db.sql must follow exactly those of the .csv view files. For SQLite, specify TEXT for date types. 84 | 85 | After this, execute: 86 | ``` 87 | 
```rm -f views_db.sqlite;sqlite3 views_db.sqlite ".read create_db.sql"``` 88 | ``` 89 | 90 | This will create a views_db.sqlite file by importing data from your csv files. Once you have the file views_db.sqlite, you will not need to run this command again. PostText will read views_db.sqlite to access the views. 91 | 92 | Specify the path of views_db.sqlite in config.ini under [input] --> "views_db". 93 | 94 | 5. Create a vectorstore of embeddings of the dataset for use by the retrieval-based QA engine. For example if your data file (not the views) is in one big csv file, you may execute the following command: 95 | 96 | To do this execute: 97 | ``` 98 | python digital_data2vectorstore.py 99 | ``` 100 | 101 | This command will generate a file called output.pkl. You can move this file to a suitable directory and specify the path of this file in config.ini under [input] --> "source_idx". The example config.ini points to timeline.pkl and you should change the path to output.pkl. Once you have this file, you do not need to execute this command again. 102 | 103 | 6. Make sure your PYTHONPATH contains the root directory of posttext. 104 | For example: 105 | 106 | ``` 107 | echo PYTHONPATH = "${PYTHONPATH}:" 108 | ``` 109 | 110 | 7. You can now run PostText. You can execute the following command from PostText's main directory. If you wish to execute with the frontend UI, please take a look at the next section. 111 | 112 | ``` 113 | python -m src.posttext data/TimelineQA/sparse-100 114 | ``` 115 | 116 | You should see the following in your terminal and you can start asking questions. 117 | 118 | ``` 119 | PostText v0.0 ====> 120 | Enter your question: 121 | ``` 122 | 123 | 124 | 125 | 126 | ## Setting up your UI 127 | 128 | Install nodejs and yarn (for frontend): 129 | ``` 130 | conda install -c conda-forge nodejs==18.10.0 yarn 131 | ``` 132 | 133 | Install some react libraries: 134 | ``` 135 | npm install primereact primeicons 136 | npm install react-syntax-highlighter 137 | ``` 138 | 139 | ### To build and start the React frontend 140 | 141 | ``` 142 | cd frontend/ 143 | yarn 144 | yarn build 145 | yarn start 146 | ``` 147 | 148 | The homepage should be available at `http://localhost:3000/`. 149 | 150 | The frontend code is at `frontend/src/App.js`. 151 | 152 | ### To start the Flask backend 153 | 154 | To run the backend, you will need to set up an OpenAI API [here](https://openai.com/api/). 155 | 156 | After that, add the API key to your env variables: 157 | 158 | ``` 159 | export OPENAI_API_KEY= 160 | ``` 161 | 162 | ``` 163 | python server.py 164 | ``` 165 | 166 | You can test the backend by curl 167 | ``` 168 | curl http://127.0.0.1:5000/test 169 | ``` 170 | 171 | You should get: 172 | ``` 173 | { 174 | "message": "okay" 175 | } 176 | ``` 177 | 178 | ## License 179 | 180 | The codebase is licensed under the [Apache 2.0 license](LICENSE). 181 | 182 | ## Contributing 183 | 184 | See [contributing](CONTRIBUTING.md) and the [code of conduct](CODE_OF_CONDUCT.md). 185 | 186 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/.gitattributes: -------------------------------------------------------------------------------- 1 | timeline.pkl filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/annual_medical_care-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,for_whom,type_of_care 2 | e40568,2022/11/04,child_medical_care,annual vision checkup 3 | e40567,2022/09/16,child_medical_care,annual physical checkup 4 | e40566,2022/06/14,child_medical_care,annual vision checkup 5 | e40565,2022/01/01,child_medical_care,annual dental cleaning and checkup 6 | e40564,2022/10/01,child_medical_care,annual physical checkup 7 | e40563,2022/06/09,personal_medical_care,annual vision checkup 8 | e40562,2022/07/17,personal_medical_care,annual dental cleaning and checkup 9 | e40561,2022/06/20,personal_medical_care,annual physical checkup 10 | e37202,2021/07/16,child_medical_care,annual dental cleaning and checkup 11 | e37201,2021/02/10,child_medical_care,annual physical checkup 12 | e37200,2021/07/26,child_medical_care,annual physical checkup 13 | e37199,2021/02/28,parent_medical_care,annual dental cleaning and checkup 14 | e37198,2021/12/26,parent_medical_care,annual physical checkup 15 | e37197,2021/10/11,personal_medical_care,annual vision checkup 16 | e37196,2021/08/03,personal_medical_care,annual dental cleaning and checkup 17 | e37195,2021/02/23,personal_medical_care,annual physical checkup 18 | e33801,2020/11/25,child_medical_care,annual vision checkup 19 | e33800,2020/06/21,child_medical_care,annual dental cleaning and checkup 20 | e33799,2020/05/04,child_medical_care,annual physical checkup 21 | e33798,2020/02/02,parent_medical_care,annual physical checkup 22 | e33797,2020/07/04,personal_medical_care,annual physical checkup 23 | e30435,2019/07/18,child_medical_care,annual vision checkup 24 | e30434,2019/12/13,child_medical_care,annual dental cleaning and checkup 25 | e30433,2019/04/12,child_medical_care,annual physical checkup 26 | e30432,2019/06/12,parent_medical_care,annual vision checkup 27 | e30431,2019/01/17,parent_medical_care,annual dental cleaning and checkup 28 | e30430,2019/12/04,parent_medical_care,annual physical checkup 29 | e30429,2019/04/18,personal_medical_care,annual dental cleaning and checkup 30 | e27015,2018/12/24,parent_medical_care,annual physical checkup 31 | e27014,2018/11/28,personal_medical_care,annual vision checkup 32 | e23626,2017/03/06,parent_medical_care,annual vision checkup 33 | e23625,2017/09/03,parent_medical_care,annual dental cleaning and checkup 34 | e23624,2017/11/14,parent_medical_care,annual physical checkup 35 | e23623,2017/11/13,personal_medical_care,annual dental cleaning and checkup 36 | e23622,2017/05/09,personal_medical_care,annual physical checkup 37 | e20257,2016/01/02,parent_medical_care,annual dental cleaning and checkup 38 | e20256,2016/01/12,parent_medical_care,annual physical checkup 39 | e20255,2016/08/22,personal_medical_care,annual dental cleaning and checkup 40 | e20254,2016/02/11,personal_medical_care,annual physical checkup 41 | e16909,2015/09/03,parent_medical_care,annual physical checkup 42 | e16908,2015/08/20,personal_medical_care,annual dental cleaning and checkup 43 | e16907,2015/07/02,personal_medical_care,annual physical checkup 44 | e13504,2014/07/03,parent_medical_care,annual dental cleaning and checkup 45 | e13503,2014/12/08,personal_medical_care,annual dental cleaning and checkup 46 | e13502,2014/05/15,personal_medical_care,annual physical checkup 47 | e10193,2013/10/11,parent_medical_care,annual vision checkup 48 | e10192,2013/02/07,parent_medical_care,annual physical checkup 49 | e10191,2013/04/05,personal_medical_care,annual physical checkup 50 | e6775,2012/07/10,parent_medical_care,annual physical checkup 51 | e6774,2012/01/06,personal_medical_care,annual vision checkup 52 | e6773,2012/10/08,personal_medical_care,annual dental cleaning and checkup 53 | e6772,2012/12/05,personal_medical_care,annual physical checkup 54 | e3398,2011/02/09,parent_medical_care,annual vision checkup 55 | e3397,2011/05/26,parent_medical_care,annual dental cleaning and checkup 56 | e3396,2011/11/18,parent_medical_care,annual physical checkup 57 | e3395,2011/05/24,personal_medical_care,annual dental cleaning and checkup 58 | e3394,2011/04/27,personal_medical_care,annual physical checkup 59 | e15,2010/01/18,parent_medical_care,annual dental cleaning and checkup 60 | e14,2010/07/16,parent_medical_care,annual physical checkup 61 | e13,2010/09/28,personal_medical_care,annual dental cleaning and checkup 62 | e12,2010/08/20,personal_medical_care,annual physical checkup 63 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/config.ini: -------------------------------------------------------------------------------- 1 | [embedding_model] 2 | model = text-embedding-ada-002 3 | encoding = cl100k_base 4 | max_tokens = 8000 5 | 6 | [Views] 7 | model_name = gpt-3.5-turbo 8 | 9 | [RAG] 10 | qa_model = gpt-3.5-turbo 11 | temperature = 0 12 | topk = 10 13 | 14 | [rag_prompt] 15 | prompt = "Use the following pieces of context and general knowledge to answer the question at the end. If the question cannot be answered with the context, ignore the context and answer with general knowledge. If you don't know the answer, just say that you don't know, don't try to make up an answer. \n\n{context}\n\nQuestion: {question} \nAnswer:" 16 | 17 | [sql_prompt] 18 | prompt = # Table name: {tablename} 19 | # Table schema: {schema} 20 | # Table description: {table_desc} 21 | # 22 | # Example rows: 23 | # 24 | # 25 | {example} 26 | # 27 | # Given the above table, schema, and description, write an aggregate SQLite query as necessary to answer the question below. The format of dates is in YYYY/MM/DD. For a range between two dates d1 and d2, use 'BETWEEN d1 and d2'. {additional_context} Avoid using the attribute eid. If an SQL query cannot be generated, please say "Sorry, no result." 28 | 29 | # 30 | # {question} 31 | SELECT 32 | 33 | [input] 34 | source_idx = timeline.pkl 35 | views_db = views_db.sqlite 36 | views_metadata = views_metadata.txt 37 | views_metadata_idx = views_idx.csv 38 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/create_db.sql: -------------------------------------------------------------------------------- 1 | PRAGMA page_size = 16384; 2 | create table annual_medical_care_log(eid TEXT PRIMARY KEY,date TEXT,for_whom TEXT,type_of_care TEXT); 3 | create table daily_chat_log(eid TEXT PRIMARY KEY,date TEXT,timeofday TEXT,howlong INTEGER,friends TEXT); 4 | create table daily_exercise_log(eid TEXT PRIMARY KEY,date TEXT,exercise TEXT,heart_rate INTEGER); 5 | create table daily_meal_log(eid TEXT PRIMARY KEY,date TEXT,mealtype TEXT,foodtype TEXT,people_string TEXT); 6 | create table daily_read_log(eid TEXT PRIMARY KEY,date TEXT,readtype TEXT,howlong INTEGER); 7 | create table daily_watchtv_log(eid TEXT PRIMARY KEY,date TEXT,watchtype TEXT,howlong INTEGER); 8 | create table marriages_log(eid TEXT PRIMARY KEY,married_date TEXT,partner_name TEXT,location TEXT); 9 | create table monthly_pet_care_log(eid TEXT PRIMARY KEY,date TEXT,pet_care_type TEXT); 10 | create table moves_log(eid TEXT PRIMARY KEY,date TEXT,type_of_move TEXT, destination TEXT); 11 | create table travel_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,people TEXT); 12 | create table travel_dining_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,dining_date TEXT,food_type TEXT,food_location TEXT,place_visit_date TEXT,place TEXT,people TEXT,action TEXT,emotion TEXT); 13 | create table travel_places_visited_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,place_visit_date TEXT,place TEXT, people TEXT,action TEXT,emotion TEXT); 14 | create table weekly_bakeorcook_log(eid TEXT PRIMARY KEY,date TEXT,cuisine TEXT,location TEXT,people TEXT); 15 | create table weekly_dating_log(eid TEXT PRIMARY KEY,date TEXT,people_string TEXT,location TEXT); 16 | create table weekly_grocery_log(eid TEXT PRIMARY KEY,date TEXT,fruits TEXT,drinks TEXT,toiletries TEXT,people_string TEXT); 17 | create table weekly_hobby_log(eid TEXT PRIMARY KEY,date TEXT,hobbies TEXT,people_string TEXT); 18 | 19 | .mode csv 20 | .import annual_medical_care-log.csv annual_medical_care_log --skip 1 21 | .import daily_meal-log.csv daily_meal_log --skip 1 22 | .import marriages-log.csv marriages_log --skip 1 23 | .import travel_places_visited-log.csv travel_places_visited_log --skip 1 24 | .import weekly_dating-log.csv weekly_dating_log --skip 1 25 | .import daily_chat-log.csv daily_chat_log --skip 1 26 | .import daily_read-log.csv daily_read_log --skip 1 27 | .import monthly_pet_care-log.csv monthly_pet_care_log --skip 1 28 | .import travel-log.csv travel_log --skip 1 29 | .import weekly_grocery-log.csv weekly_grocery_log --skip 1 30 | .import daily_exercise-log.csv daily_exercise_log --skip 1 31 | .import daily_watchtv-log.csv daily_watchtv_log --skip 1 32 | .import moves-log.csv moves_log --skip 1 33 | .import travel_dining-log.csv travel_dining_log --skip 1 34 | .import weekly_bakeorcook-log.csv weekly_bakeorcook_log --skip 1 35 | .import weekly_hobby-log.csv weekly_hobby_log --skip 1 36 | 37 | 38 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/marriages-log.csv: -------------------------------------------------------------------------------- 1 | eid,married_date,partner_name,location 2 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/monthly_pet_care-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,pet_care_type 2 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/moves-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,type_of_move,destination 2 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/timeline.pkl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:691c42cf305577f807ef02e92548ef692fa167a439655ca9e55daa37d2b8d414 3 | size 277709424 4 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/travel-log.csv: -------------------------------------------------------------------------------- 1 | eid,start_date,end_date,city,people 2 | e40550,2022/05/24,2022/05/27,"New York, US","Claire, Piper" 3 | e37189,2021/01/11,2021/01/17,"Shanghai, China","Kayden, Carter, Emily" 4 | e33784,2020/05/01,2020/05/12,"Paris, France",Piper 5 | e30415,2019/02/21,2019/03/02,"Bangkok, Thailand","Lydia, Hazel" 6 | e27006,2018/03/20,2018/03/26,"Seoul, South Korea",Avery 7 | e23609,2017/01/10,2017/01/21,"Sydney, Australia","Andrew, Kayden" 8 | e20243,2016/03/27,2016/04/02,"London, UK",Piper 9 | e16891,2015/01/15,2015/01/26,"Rio, Brazil","Andrew, Carter" 10 | e13493,2014/05/21,2014/05/24,"Los Angeles, US","Willow, Jackson, Avery" 11 | e10175,2013/05/03,2013/05/18,"Seoul, South Korea","Avery, Jackson" 12 | e6764,2012/03/07,2012/03/12,"Bangkok, Thailand","Benjamin, Avery, Willow" 13 | e3378,2011/02/24,2011/03/06,"Bangkok, Thailand",Andrew 14 | e1,2010/02/12,2010/02/18,"Philadelphia, US","Carter, Kayden" 15 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/travel_dining-log.csv: -------------------------------------------------------------------------------- 1 | eid,start_date,end_date,city,dining_date,food_type,food_location,place_visit_date,place,people,action,emotion 2 | e7,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/13,Chinese food,High Street Philly,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 3 | e8,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/15,Chinese food,High Street Philly,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 4 | e9,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/16,street food,Lunch Street,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 5 | e10,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/17,Japanese food,High Street Philly,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 6 | e11,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/18,Japanese food,Wood Street Pizza,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 7 | e3384,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/02/25,Chinese food,Ratchawat Market,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 8 | e3385,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/02/26,Italian food,Yaowarat,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 9 | e3386,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/02/27,Japanese food,Yaowarat,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 10 | e3387,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/02/28,Indian food,Ratchawat Market,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 11 | e3388,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/03/01,Japanese food,Yaowarat,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 12 | e3389,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/03/02,Chinese food,Victory Monument,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 13 | e3390,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/03/03,Chinese food,Ratchawat Market,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 14 | e3391,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/03/04,Italian food,Ratchawat Market,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 15 | e3392,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/03/05,street food,Ratchawat Market,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 16 | e3393,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/03/06,street food,Victory Monument,2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 17 | e6770,2012/03/07,2012/03/12,"Bangkok, Thailand",2012/03/08,Italian food,Victory Monument,2012/03/12,National Museum & Wang Na Palace,"Benjamin, Avery, Willow",took a selfie,impressed 18 | e6771,2012/03/07,2012/03/12,"Bangkok, Thailand",2012/03/09,Japanese food,Yaowarat,2012/03/12,National Museum & Wang Na Palace,"Benjamin, Avery, Willow",took a selfie,impressed 19 | e10179,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/05,street food,Gwangjang Market,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 20 | e10180,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/07,Japanese food,Gwangjang Market,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 21 | e10181,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/08,Indian food,Common Ground,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 22 | e10182,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/09,Japanese food,Gwangjang Market,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 23 | e10183,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/10,Chinese food,Common Ground,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 24 | e10184,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/11,Chinese food,Seoul Bamdokkaebi Night Market,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 25 | e10185,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/12,Indian food,Myeongdong Street Food Alley,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 26 | e10186,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/13,local food,Myeongdong Street Food Alley,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 27 | e10187,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/15,Italian food,Myeongdong Street Food Alley,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 28 | e10188,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/16,Chinese food,Common Ground,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 29 | e10189,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/17,local food,Myeongdong Street Food Alley,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 30 | e10190,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/18,Japanese food,Myeongdong Street Food Alley,2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 31 | e13499,2014/05/21,2014/05/24,"Los Angeles, US",2014/05/22,Italian food,Es Todo Vegan Street Food,2014/05/26,Universal Studios Hollywood,"Willow, Jackson, Avery",took a group photo,happy 32 | e13500,2014/05/21,2014/05/24,"Los Angeles, US",2014/05/23,Chinese food,Guatemalan Night Market,2014/05/26,Universal Studios Hollywood,"Willow, Jackson, Avery",took a group photo,happy 33 | e13501,2014/05/21,2014/05/24,"Los Angeles, US",2014/05/24,Indian food,Guatemalan Night Market,2014/05/26,Universal Studios Hollywood,"Willow, Jackson, Avery",took a group photo,happy 34 | e16897,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/16,Italian food,Pão de queijo,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 35 | e16898,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/17,street food,Pão de queijo,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 36 | e16899,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/18,Italian food,Bolinho de bacalhau,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 37 | e16900,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/19,street food,Tapioca,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 38 | e16901,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/20,Italian food,Bolinho de bacalhau,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 39 | e16902,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/21,Italian food,Pão de queijo,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 40 | e16903,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/22,street food,Pão de queijo,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 41 | e16904,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/24,local food,Tapioca,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 42 | e16905,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/25,Italian food,Tapioca,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 43 | e16906,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/26,Indian food,Pão de queijo,2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 44 | e20249,2016/03/27,2016/04/02,"London, UK",2016/03/28,Chinese food,Broadway Market,2016/04/01,Hyde Park,Piper,bought some souvenirs,special 45 | e20250,2016/03/27,2016/04/02,"London, UK",2016/03/29,Japanese food,Bang Bang Oriental,2016/04/01,Hyde Park,Piper,bought some souvenirs,special 46 | e20251,2016/03/27,2016/04/02,"London, UK",2016/03/30,Japanese food,Brixton Village,2016/04/01,Hyde Park,Piper,bought some souvenirs,special 47 | e20252,2016/03/27,2016/04/02,"London, UK",2016/04/01,Indian food,Berwick Street Market,2016/04/01,Hyde Park,Piper,bought some souvenirs,special 48 | e20253,2016/03/27,2016/04/02,"London, UK",2016/04/02,local food,Bang Bang Oriental,2016/04/01,Hyde Park,Piper,bought some souvenirs,special 49 | e23613,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/11,street food,Love Crepe,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 50 | e23614,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/12,local food,Bombay Street Kitchen,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 51 | e23615,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/13,street food,Love Crepe,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 52 | e23616,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/14,Italian food,Thievery Chicken & Charcoal,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 53 | e23617,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/15,Japanese food,Thievery Chicken & Charcoal,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 54 | e23618,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/16,local food,Bombay Street Kitchen,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 55 | e23619,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/17,Japanese food,Bombay Street Kitchen,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 56 | e23620,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/19,Indian food,Thievery Chicken & Charcoal,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 57 | e23621,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/21,Japanese food,Bombay Street Kitchen,2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 58 | e27010,2018/03/20,2018/03/26,"Seoul, South Korea",2018/03/21,street food,Common Ground,2018/03/23,N Seoul Tower,Avery,took a selfie,special 59 | e27011,2018/03/20,2018/03/26,"Seoul, South Korea",2018/03/22,Italian food,Myeongdong Street Food Alley,2018/03/23,N Seoul Tower,Avery,took a selfie,special 60 | e27012,2018/03/20,2018/03/26,"Seoul, South Korea",2018/03/25,Indian food,Gwangjang Market,2018/03/23,N Seoul Tower,Avery,took a selfie,special 61 | e27013,2018/03/20,2018/03/26,"Seoul, South Korea",2018/03/26,Japanese food,Seoul Bamdokkaebi Night Market,2018/03/23,N Seoul Tower,Avery,took a selfie,special 62 | e30421,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/22,Chinese food,Yaowarat,2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 63 | e30422,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/23,Indian food,Ratchawat Market,2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 64 | e30423,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/25,Indian food,Ratchawat Market,2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 65 | e30424,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/26,Indian food,Victory Monument,2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 66 | e30425,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/27,local food,Ratchawat Market,2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 67 | e30426,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/28,street food,Yaowarat,2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 68 | e30427,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/03/01,street food,Ratchawat Market,2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 69 | e30428,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/03/02,Italian food,Yaowarat,2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 70 | e33790,2020/05/01,2020/05/12,"Paris, France",2020/05/02,Italian food,Man’Ouché,2020/05/06,Louvre Museum,Piper,recorded some videos,impressed 71 | e33791,2020/05/01,2020/05/12,"Paris, France",2020/05/03,Indian food,Man’Ouché,2020/05/06,Louvre Museum,Piper,recorded some videos,impressed 72 | e33792,2020/05/01,2020/05/12,"Paris, France",2020/05/04,Indian food,Le Food Market,2020/05/06,Louvre Museum,Piper,recorded some videos,impressed 73 | e33793,2020/05/01,2020/05/12,"Paris, France",2020/05/06,Chinese food,Man’Ouché,2020/05/06,Louvre Museum,Piper,recorded some videos,impressed 74 | e33794,2020/05/01,2020/05/12,"Paris, France",2020/05/08,Chinese food,Man’Ouché,2020/05/06,Louvre Museum,Piper,recorded some videos,impressed 75 | e33795,2020/05/01,2020/05/12,"Paris, France",2020/05/09,local food,Le Food Market,2020/05/06,Louvre Museum,Piper,recorded some videos,impressed 76 | e33796,2020/05/01,2020/05/12,"Paris, France",2020/05/11,Italian food,Le Food Market,2020/05/06,Louvre Museum,Piper,recorded some videos,impressed 77 | e37190,2021/01/11,2021/01/17,"Shanghai, China",2021/01/12,Italian food,Fangbang Xi Lu,,,,, 78 | e37191,2021/01/11,2021/01/17,"Shanghai, China",2021/01/13,Indian food,Yuyuan Lu junction,,,,, 79 | e37192,2021/01/11,2021/01/17,"Shanghai, China",2021/01/14,local food,South Bund Fabric Market,,,,, 80 | e37193,2021/01/11,2021/01/17,"Shanghai, China",2021/01/16,Japanese food,Fangbang Xi Lu,,,,, 81 | e37194,2021/01/11,2021/01/17,"Shanghai, China",2021/01/17,Chinese food,Fangbang Xi Lu,,,,, 82 | e40558,2022/05/24,2022/05/27,"New York, US",2022/05/25,Japanese food,The Halal Guys,2022/05/31,Empire State Building,"Claire, Piper",took a selfie,happy 83 | e40559,2022/05/24,2022/05/27,"New York, US",2022/05/26,Japanese food,Melt Bakery,2022/05/31,Empire State Building,"Claire, Piper",took a selfie,happy 84 | e40560,2022/05/24,2022/05/27,"New York, US",2022/05/27,Italian food,Nuts 4 Nuts,2022/05/31,Empire State Building,"Claire, Piper",took a selfie,happy 85 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/travel_places_visited-log.csv: -------------------------------------------------------------------------------- 1 | eid,start_date,end_date,city,place_visit_date,place,people,action,emotion 2 | e2,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/13,Liberty Bell,"Carter, Kayden",took a group photo,impressed 3 | e3,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/14,Philadelphia Museum of Art,"Carter, Kayden",recorded some videos,happy 4 | e4,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/15,Ipanema,"Carter, Kayden",bought some souvenirs,happy 5 | e5,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/16,Carnaval,"Carter, Kayden",took a selfie,impressed 6 | e6,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 7 | e3379,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/02/25,Wat Suthat,Andrew,took a group photo,special 8 | e3380,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/02/26,Grand Palace,Andrew,took a group photo,special 9 | e3381,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/02/27,Wat Traimit,Andrew,bought some souvenirs,impressed 10 | e3382,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/02/28,Wat Arun,Andrew,took a selfie,special 11 | e3383,2011/02/24,2011/03/06,"Bangkok, Thailand",2011/03/01,National Museum & Wang Na Palace,Andrew,took a selfie,special 12 | e6765,2012/03/07,2012/03/12,"Bangkok, Thailand",2012/03/08,Grand Palace,"Benjamin, Avery, Willow",bought some souvenirs,happy 13 | e6766,2012/03/07,2012/03/12,"Bangkok, Thailand",2012/03/09,Wat Traimit,"Benjamin, Avery, Willow",took a selfie,impressed 14 | e6767,2012/03/07,2012/03/12,"Bangkok, Thailand",2012/03/10,Wat Arun,"Benjamin, Avery, Willow",bought some souvenirs,happy 15 | e6768,2012/03/07,2012/03/12,"Bangkok, Thailand",2012/03/11,Wat Suthat,"Benjamin, Avery, Willow",took a group photo,impressed 16 | e6769,2012/03/07,2012/03/12,"Bangkok, Thailand",2012/03/12,National Museum & Wang Na Palace,"Benjamin, Avery, Willow",took a selfie,impressed 17 | e10176,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/04,Lotte World Tower,"Avery, Jackson",bought some souvenirs,special 18 | e10177,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/05,N Seoul Tower,"Avery, Jackson",took a selfie,impressed 19 | e10178,2013/05/03,2013/05/18,"Seoul, South Korea",2013/05/06,National Museum Of Korea,"Avery, Jackson",took a group photo,impressed 20 | e13494,2014/05/21,2014/05/24,"Los Angeles, US",2014/05/22,Hollywood Walk of Fame,"Willow, Jackson, Avery",recorded some videos,happy 21 | e13495,2014/05/21,2014/05/24,"Los Angeles, US",2014/05/23,Santa Monica Pier,"Willow, Jackson, Avery",took a group photo,special 22 | e13496,2014/05/21,2014/05/24,"Los Angeles, US",2014/05/24,Griffith Park and Observatory,"Willow, Jackson, Avery",recorded some videos,special 23 | e13497,2014/05/21,2014/05/24,"Los Angeles, US",2014/05/25,Getty Center,"Willow, Jackson, Avery",took a selfie,impressed 24 | e13498,2014/05/21,2014/05/24,"Los Angeles, US",2014/05/26,Universal Studios Hollywood,"Willow, Jackson, Avery",took a group photo,happy 25 | e16892,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/16,Ipanema,"Andrew, Carter",took a selfie,special 26 | e16893,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/17,Copacabana,"Andrew, Carter",took a selfie,impressed 27 | e16894,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/18,Sugarloaf,"Andrew, Carter",recorded some videos,special 28 | e16895,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/19,Cristo Redentor,"Andrew, Carter",took a group photo,happy 29 | e16896,2015/01/15,2015/01/26,"Rio, Brazil",2015/01/20,Carnaval,"Andrew, Carter",bought some souvenirs,happy 30 | e20244,2016/03/27,2016/04/02,"London, UK",2016/03/28,London Eye,Piper,bought some souvenirs,impressed 31 | e20245,2016/03/27,2016/04/02,"London, UK",2016/03/29,Westminster,Piper,took a group photo,impressed 32 | e20246,2016/03/27,2016/04/02,"London, UK",2016/03/30,Camden,Piper,took a selfie,happy 33 | e20247,2016/03/27,2016/04/02,"London, UK",2016/03/31,Tower of London,Piper,recorded some videos,special 34 | e20248,2016/03/27,2016/04/02,"London, UK",2016/04/01,Hyde Park,Piper,bought some souvenirs,special 35 | e23610,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/11,Bondi Beach,"Andrew, Kayden",took a selfie,happy 36 | e23611,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/12,Sydney Opera House,"Andrew, Kayden",bought some souvenirs,special 37 | e23612,2017/01/10,2017/01/21,"Sydney, Australia",2017/01/13,Sydney Harbour Bridge,"Andrew, Kayden",took a selfie,impressed 38 | e27007,2018/03/20,2018/03/26,"Seoul, South Korea",2018/03/21,Lotte World Tower,Avery,took a group photo,special 39 | e27008,2018/03/20,2018/03/26,"Seoul, South Korea",2018/03/22,National Museum Of Korea,Avery,bought some souvenirs,special 40 | e27009,2018/03/20,2018/03/26,"Seoul, South Korea",2018/03/23,N Seoul Tower,Avery,took a selfie,special 41 | e30416,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/22,Wat Traimit,"Lydia, Hazel",recorded some videos,happy 42 | e30417,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/23,Grand Palace,"Lydia, Hazel",took a group photo,impressed 43 | e30418,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/24,National Museum & Wang Na Palace,"Lydia, Hazel",recorded some videos,special 44 | e30419,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/25,Wat Suthat,"Lydia, Hazel",took a group photo,special 45 | e30420,2019/02/21,2019/03/02,"Bangkok, Thailand",2019/02/26,Wat Arun,"Lydia, Hazel",took a group photo,special 46 | e33785,2020/05/01,2020/05/12,"Paris, France",2020/05/02,Eiffel Tower,Piper,took a group photo,impressed 47 | e33786,2020/05/01,2020/05/12,"Paris, France",2020/05/03,Notre Dame Cathedral,Piper,recorded some videos,impressed 48 | e33787,2020/05/01,2020/05/12,"Paris, France",2020/05/04,Montmartre,Piper,took a group photo,impressed 49 | e33788,2020/05/01,2020/05/12,"Paris, France",2020/05/05,Champs Elysées,Piper,took a selfie,impressed 50 | e33789,2020/05/01,2020/05/12,"Paris, France",2020/05/06,Louvre Museum,Piper,recorded some videos,impressed 51 | e40551,2022/05/24,2022/05/27,"New York, US",2022/05/25,Statue of Liberty,"Claire, Piper",took a selfie,happy 52 | e40552,2022/05/24,2022/05/27,"New York, US",2022/05/26,Central Park,"Claire, Piper",took a selfie,impressed 53 | e40553,2022/05/24,2022/05/27,"New York, US",2022/05/27,Times Square,"Claire, Piper",took a selfie,impressed 54 | e40554,2022/05/24,2022/05/27,"New York, US",2022/05/28,Brooklyn Bridge,"Claire, Piper",took a selfie,happy 55 | e40555,2022/05/24,2022/05/27,"New York, US",2022/05/29,Rockefeller Center,"Claire, Piper",recorded some videos,special 56 | e40556,2022/05/24,2022/05/27,"New York, US",2022/05/30,Metropolitan Museum of Art,"Claire, Piper",took a group photo,happy 57 | e40557,2022/05/24,2022/05/27,"New York, US",2022/05/31,Empire State Building,"Claire, Piper",took a selfie,happy 58 | -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/views_db.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/PostText/85ba698d2892eae8daeed5ca037079b584d779b2/data/TimelineQA/dense-100/views_db.sqlite -------------------------------------------------------------------------------- /data/TimelineQA/dense-100/views_metadata.txt: -------------------------------------------------------------------------------- 1 | #This file contains meta data about views. 2 | #name: The name of the view, 3 | #description: a text description of what the view contains, 4 | #schema: the schema, 5 | #example queries: examples of questions that may be posed against this view 6 | #additional_context: additional special instructions to pass to codex 7 | #foreign key: optionally foreign keys if available, 8 | #: and a description of each attribute. 9 | 10 | name: annual_medical_care_log 11 | description: different types of medical appointments for myself, my children/kids, or my parents, and when. E.g., I brought my kids for their vision checkup on Jan 03, 2021. 12 | schema: (eid,date,for_whom,type_of_care) 13 | example queries: When was my last vision checkup? How many dental appointments did my kids have in 2020? When did my parents go for their medical checkup in 2021? 14 | additional_context: The for_whom column describes checkups for myself as "personal_medical_checkup". 15 | foreign key: - 16 | eid: TEXT // primary key 17 | date: DATETYPE // the day of the appointment. 18 | for_whom: TEXT // who the medical appointment is for (parents, children, or self) TEXT 19 | type_of_care: TEXT // the type of medical appointment (dental, vision, physical) 20 | 21 | name: daily_chat_log 22 | description: records talks/chats with people on some date and time. E.g., I spent 24 minutes talking to Emily and Bob on the morning of August 6, 2017. 23 | schema: (eid,date,timeofday,howlong,friends) 24 | example queries: When was the last time I chat with Rachel in the morning? How long did I chat with my friends yesterday? Who did I talk to on 12 May, 2018? 25 | additional_context: 26 | foreign key: - 27 | eid: TEXT // primary key 28 | date: DATETYPE // the day the chat/talk took place 29 | timeofday: TEXT // when the chat/talk took place during the day (morning, afternoon, or evening) 30 | howlong: INTEGER // the length/duration of the chat/talk in minutes 31 | friends: TEXT // the list of people whom I talked to 32 | 33 | name: daily_exercise_log 34 | description: records of different types of exercises done (running/jogging, swimming, walking etc.) and the corresponding heart rate. E.g., I went swimming on Jun 20, 2019 and my average heart rate was 145BPM. 35 | schema: (eid,date,exercise,heart_rate) 36 | example queries: how many times did I run or bike last month? Which month did I exercise the most? Which year did I exercise the most? 37 | additional_context: 38 | foreign key: - 39 | eid: TEXT // primary key 40 | date: DATETYPE // the day of exercise 41 | exercise: TEXT // type of exercise (swimming, running/jogging, yoga, walking, etc.) 42 | heart_rate: INTEGER // the average heart rate in BPM during exercise 43 | 44 | name: daily_meal_log 45 | description: records of meals eaten, types of food, friends or people involved, and on which day or date. E.g., I had oatmeal for breakfast on April 7, 2011 with John and Carter. 46 | schema: (eid,date,mealtype,foodtype,people_string) 47 | example queries: How many times did I have cereals for breakfast in April 2020? What did I last eat with Jane for lunch? 48 | additional_context: 49 | foreign key: - 50 | eid: TEXT // primary key 51 | date: DATETYPE // the day of the meal 52 | mealtype: TEXT // type of meal (breakfast, lunch, dinner, snack) 53 | foodtype: TEXT // type of food (chinese, pasta, tacos etc.) 54 | people_string: TEXT // list of people or friends 55 | 56 | name: daily_read_log 57 | description: what is read (e.g., books, news, social media) and for how long 58 | schema: (eid,date,readtype,howlong). E.g., I spent 30 mins reading news on 22 June 2018. 59 | example queries: how much time did I spend on social media or the news last month? How many books did I read in 2020? 60 | additional_context: 61 | foreign key: - 62 | eid: TEXT // primary key 63 | date: DATETYPE // date the reading activity took place 64 | readtype: TEXT // source of reading material (books, news, magazine, social media) 65 | howlong: INTEGER // the length/duration of the reading activity 66 | 67 | name: daily_watchtv_log 68 | description: what is watched on tv (e.g., movie, tv series, documentary, or news), on which day or date and for how long. E.g., I watched a movie for 2 hrs on 18 June 2019. 69 | schema: (eid,date,watchtype,howlong) 70 | example queries: When was the last time I watch a movie or news? How long did I spend watching tv in 2020 71 | additional_context: 72 | foreign key: - 73 | eid: TEXT // primary key 74 | date: DATETYPE // the day where this event, watching tv, occurred 75 | watchtype: TEXT // what is watched on tv (movie, tv series, news) 76 | howlong: INTEGER // the length/duration spent watching tv 77 | 78 | name: marriages_log 79 | description: records the date of marriage, name of spouse or partner, and where the marriage took place. E.g., I married John on May 2, 2010 in Marin County, California. 80 | schema: (eid,married_date,partner_name,location) 81 | example queries: when was my first marriage and where? How many times did I get married? 82 | additional_context: 83 | foreign key: - 84 | eid: TEXT // primary key 85 | married_date: DATETYPE // the date of marriage 86 | partner_name: TEXT // name of partner or spouse 87 | location: TEXT // the location where the marriage took place 88 | 89 | name: monthly_pet_care_log 90 | description: date that the pet (e.g., dog or cat) was taking for grooming or medical checkups. E.g., Roki was groomed and had his nails trimmed on 2 Jan 2022. 91 | schema: (eid,date,pet_care_type) 92 | example queries: When did I last take Rocky to a bath? How many times did Rocky groom and got his nails trimmed in 2021? Did Rocky go for a medical checkup last year? 93 | additional_context: 94 | foreign key: - 95 | eid: TEXT // primary key 96 | date: DATETYPE // the day of the pet care or grooming 97 | pet_care_type: TEXT // grooming (bath, grooming, nail trim) 98 | 99 | name: moves_log 100 | description: when a move or relocation was made and the destination location. E.g., I moved to Madison, Wisconsin for college on 20 August, 2018. 101 | schema: (id,date,type_of_move,destination) 102 | example queries: when did I move to college? 103 | additional_context: 104 | foreign key: - 105 | eid: TEXT // primary key 106 | date: DATETYPE // the day of of the move 107 | type_of_move: TEXT // the type of move or reason for moving (move due to job, college, graduate school) 108 | destination: TEXT // the place moved to 109 | 110 | name: travel_log 111 | description: record of where I traveled, the travel destination, with whom, and the start and end dates of travel. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 with John and Carter. 112 | schema: (eid,start_date,end_date,city,people) 113 | example queries: When did I visit Tokyo in 2021? Who did I go London with in 2021? How long was I in Taipei, Taiwan in 2021? 114 | additional_context: 115 | foreign key: - 116 | eid: TEXT // primary key 117 | start_date: DATETYPE // the first day of travel for this record 118 | end_date: DATETYPE // the last day of travel for this record 119 | city: TEXT // the destination or city traveled to 120 | people: TEXT // the people or friends traveling with you 121 | 122 | name: travel_dining_log 123 | description: records of dining events or meals during travel at the city, the food, the place where the meal took place, the date of the dining event, the people or friends at the dining event, and the emotion associated. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 and had pasta at Pier 39. 124 | schema: (eid,start_date,end_date,city,dining_date,food_type,food_location,place_visit_date,place,people,action,emotion) 125 | example queries: what did I last eat in Philadelphia? Where was the location of the restaurant I dined in the last day of London? 126 | additional_context: 127 | foreign key: (eid,start_date,end_date,city) is a foreign key in travel_log 128 | eid: TEXT // primary key 129 | start_date: DATETYPE // the first day of travel for this record 130 | end_date: DATETYPE // the last day of travel for this record 131 | city: TEXT // the destination or city traveled to 132 | dining_date: DATETYPE // the date this dining event took place 133 | food_type: TEXT // type of food (Chinese, Italian, Indian, Japanese, etc.) 134 | food_location: TEXT // name of restaurant or street name where the meal took place 135 | place_visit_date: DATETYPE // date that place was visited during the same trip 136 | place: TEXT // a place visited during the same trip 137 | people: TEXT // list of people or friends who were at the same trip 138 | action: TEXT // an activity done during at the place that was visited (took a group photo, or a selfie, bought souvenirs) 139 | emotion: TEXT // feelings associated with the action taken (happy, impressed) 140 | 141 | name: travel_places_visited_log 142 | description: the start and end date of the travel, the city visited (e.g., London, Sydney) and with whom and the things done. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 and visited Union Square with John and Carter on September 8, 2019. We took some pictures and were happy. 143 | schema: (eid,start_date,end_date,city,place_visit_date,place,people,action,emotion) 144 | example queries: How many places did I visit when I was in Tokyo in 2021? Did I go to the Museum of Arts when I last visited Philadelphia? 145 | additional_context: 146 | foreign key: (eid,start_date,end_date,city) is a foreign key in travel_log 147 | eid: TEXT // primary key 148 | start_date: DATETYPE // the first day of travel for this record 149 | end_date: DATETYPE // the last day of travel for this record 150 | city: TEXT // the destination or city traveled to 151 | place_visit_date: DATETYPE // date that place was visited during the same trip 152 | place: TEXT // a place visited during the same trip 153 | people: TEXT // list of people or friends who were at the same trip 154 | action: TEXT // an activity done during at the place that was visited (took a group photo, or a selfie, bought souvenirs) 155 | emotion: TEXT // feelings associated with the action taken (happy, impressed) 156 | 157 | name: weekly_bakeorcook_log 158 | description: records the type of dishes or cuisines I make (e.g., dessert, pie, jam, cookies), where it was made and with whom and the day it was made. E.g., I baked chocolate cake at my place with Amy and Brandy on February 6, 2019. 159 | schema: (eid,date,cuisine,location,people) 160 | example queries: When did I last bake a pie? What dishes did I cook the most often in 2021? Who made a chocolate cake with me in April 2022? How many times did I make bread in 2022? 161 | additional_context: 162 | foreign key: - 163 | eid: TEXT // primary key 164 | date: DATETYPE // the day the baking or cooking took place 165 | cuisine: TEXT // the type of dish made (chocolate chip, cake, steak, chinese stir fry) 166 | location: TEXT // the place where was the dish made. Usually it is "my place" 167 | people: TEXT // the list of people or friends' names 168 | 169 | name: weekly_dating_log 170 | description: records of dating events, including the name of the date and the location where the dating took place. E.g., I dated Jimmy on May 3, 2018 at Filoli Gardens. 171 | schema: (eid,date,people_string,location) 172 | example queries: where did I spend time with Avery in 2022? 173 | additional_context: 174 | foreign key: - 175 | eid: TEXT // primary key 176 | date: DATETYPE // the day when the dating event happened 177 | people_string: TEXT // the people in the dating event 178 | location: TEXT // the location of the dating event 179 | 180 | name: weekly_grocery_log 181 | description: records of the fruits, drinks, and toiletries shopped and bought during a certain day, and the people involved in the same grocery shopping trip. E.g., I bought strawberries and bananas, milk, and toothpaste from the supermarket with Jimmy and Carter. 182 | schema: (eid,date,fruits,drinks,toiletries,people_string) 183 | example queries: How many trips did I make to the supermarket in April 2021? When did I last buy toothpaste? How many times did I buy fruits in May 2020? 184 | additional_context: 185 | foreign key: - 186 | eid: TEXT // primary key 187 | date: DATETYPE // the day the groceries were purchased 188 | fruits: TEXT // fruits (apples, peaches, guava, bananas, etc.) 189 | drinks: TEXT // drinks (mango juice, soda, milk, water, etc.) 190 | toiletries: TEXT // toiletries (toothpaste, facial/body/mouth wash, facial/body/hand lotion etc.) 191 | people_string: TEXT // the people or friends who were also there for this shopping event 192 | 193 | name: weekly_hobby_log 194 | description: records which hobbies were carried out during a certain day and the people involved. What did I do? What did I do on a certain day and with whom? E.g., I meditated with John on January 15, 2017. 195 | schema: (eid,date,hobbies,people_string) 196 | example queries: How many times did I meditate in 2021? How many times did I work out in May 2021? 197 | additional_context: 198 | foreign key: - 199 | eid: TEXT // primary key 200 | date: DATETYPE // the day the hobby was done 201 | hobbies: TEXT // an activity that is carried out regularly (meditation, yoga, jogging, working out) 202 | people_string: TEXT // the people or friends who were together for this hobby 203 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/.gitattributes: -------------------------------------------------------------------------------- 1 | timeline.pkl filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/annual_medical_care-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,for_whom,type_of_care 2 | e18129,2022/03/11,child_medical_care,annual physical checkup 3 | e18128,2022/11/27,child_medical_care,annual dental cleaning and checkup 4 | e18127,2022/10/01,child_medical_care,annual physical checkup 5 | e18126,2022/08/28,parent_medical_care,annual vision checkup 6 | e18125,2022/02/18,parent_medical_care,annual dental cleaning and checkup 7 | e18124,2022/07/26,parent_medical_care,annual physical checkup 8 | e18123,2022/09/01,personal_medical_care,annual vision checkup 9 | e18122,2022/05/20,personal_medical_care,annual dental cleaning and checkup 10 | e16611,2021/02/25,child_medical_care,annual physical checkup 11 | e16610,2021/04/28,child_medical_care,annual dental cleaning and checkup 12 | e16609,2021/06/04,parent_medical_care,annual dental cleaning and checkup 13 | e16608,2021/05/21,personal_medical_care,annual vision checkup 14 | e16607,2021/12/25,personal_medical_care,annual dental cleaning and checkup 15 | e15129,2020/06/27,child_medical_care,annual vision checkup 16 | e15128,2020/03/03,child_medical_care,annual dental cleaning and checkup 17 | e15127,2020/08/05,child_medical_care,annual physical checkup 18 | e15126,2020/05/15,parent_medical_care,annual dental cleaning and checkup 19 | e15125,2020/04/18,parent_medical_care,annual physical checkup 20 | e15124,2020/09/28,personal_medical_care,annual dental cleaning and checkup 21 | e15123,2020/07/06,personal_medical_care,annual physical checkup 22 | e13644,2019/12/02,child_medical_care,annual vision checkup 23 | e13643,2019/09/07,child_medical_care,annual dental cleaning and checkup 24 | e13642,2019/04/19,child_medical_care,annual physical checkup 25 | e13641,2019/07/13,parent_medical_care,annual physical checkup 26 | e13640,2019/03/23,personal_medical_care,annual dental cleaning and checkup 27 | e12168,2018/09/22,parent_medical_care,annual dental cleaning and checkup 28 | e12167,2018/05/22,parent_medical_care,annual physical checkup 29 | e12166,2018/05/06,personal_medical_care,annual dental cleaning and checkup 30 | e10658,2017/10/27,parent_medical_care,annual physical checkup 31 | e10657,2017/11/25,personal_medical_care,annual dental cleaning and checkup 32 | e9105,2016/11/28,parent_medical_care,annual dental cleaning and checkup 33 | e9104,2016/04/26,parent_medical_care,annual physical checkup 34 | e9103,2016/01/14,personal_medical_care,annual dental cleaning and checkup 35 | e9102,2016/05/06,personal_medical_care,annual physical checkup 36 | e7597,2015/09/08,parent_medical_care,annual dental cleaning and checkup 37 | e7596,2015/05/12,parent_medical_care,annual physical checkup 38 | e7595,2015/03/11,personal_medical_care,annual vision checkup 39 | e7594,2015/08/04,personal_medical_care,annual physical checkup 40 | e6057,2014/11/24,parent_medical_care,annual physical checkup 41 | e6056,2014/12/06,personal_medical_care,annual physical checkup 42 | e4599,2013/05/17,parent_medical_care,annual dental cleaning and checkup 43 | e4598,2013/09/19,parent_medical_care,annual physical checkup 44 | e4597,2013/06/26,personal_medical_care,annual vision checkup 45 | e4596,2013/12/27,personal_medical_care,annual dental cleaning and checkup 46 | e4595,2013/11/25,personal_medical_care,annual physical checkup 47 | e3066,2012/10/16,parent_medical_care,annual dental cleaning and checkup 48 | e3065,2012/10/24,parent_medical_care,annual physical checkup 49 | e3064,2012/02/24,personal_medical_care,annual vision checkup 50 | e3063,2012/01/08,personal_medical_care,annual dental cleaning and checkup 51 | e3062,2012/08/04,personal_medical_care,annual physical checkup 52 | e1529,2011/09/10,parent_medical_care,annual dental cleaning and checkup 53 | e1528,2011/12/14,parent_medical_care,annual physical checkup 54 | e1527,2011/03/07,personal_medical_care,annual dental cleaning and checkup 55 | e1526,2011/03/07,personal_medical_care,annual physical checkup 56 | e15,2010/01/18,parent_medical_care,annual dental cleaning and checkup 57 | e14,2010/07/16,parent_medical_care,annual physical checkup 58 | e13,2010/09/28,personal_medical_care,annual dental cleaning and checkup 59 | e12,2010/08/20,personal_medical_care,annual physical checkup 60 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/config.ini: -------------------------------------------------------------------------------- 1 | [embedding_model] 2 | model = text-embedding-ada-002 3 | encoding = cl100k_base 4 | max_tokens = 8000 5 | 6 | [Views] 7 | model_name = gpt-3.5-turbo 8 | 9 | [RAG] 10 | qa_model = gpt-3.5-turbo 11 | temperature = 0 12 | topk = 10 13 | 14 | [rag_prompt] 15 | prompt = "Use the following pieces of context and general knowledge to answer the question at the end. If the question cannot be answered with the context, ignore the context and answer with general knowledge. If you don't know the answer, just say that you don't know, don't try to make up an answer. \n\n{context}\n\nQuestion: {question} \nAnswer:" 16 | 17 | [sql_prompt] 18 | prompt = # Table name: {tablename} 19 | # Table schema: {schema} 20 | # Table description: {table_desc} 21 | # 22 | # Example rows: 23 | # 24 | # 25 | {example} 26 | # 27 | # Given the above table, schema, and description, write an aggregate SQLite query as necessary to answer the question below. The format of dates is in YYYY/MM/DD. For a range between two dates d1 and d2, use 'BETWEEN d1 and d2'. {additional_context} Avoid using the attribute eid. If an SQL query cannot be generated, please say "Sorry, no result." 28 | 29 | # 30 | # {question} 31 | SELECT 32 | 33 | [input] 34 | source_idx = timeline.pkl 35 | views_db = views_db.sqlite 36 | views_metadata = views_metadata.txt 37 | views_metadata_idx = views_idx.csv 38 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/create_db.sql: -------------------------------------------------------------------------------- 1 | PRAGMA page_size = 8192; 2 | create table annual_medical_care_log(eid TEXT PRIMARY KEY,date TEXT,for_whom TEXT,type_of_care TEXT); 3 | create table daily_chat_log(eid TEXT PRIMARY KEY,date TEXT,timeofday TEXT,howlong INTEGER,friends TEXT); 4 | create table daily_exercise_log(eid TEXT PRIMARY KEY,date TEXT,exercise TEXT,heart_rate INTEGER); 5 | create table daily_meal_log(eid TEXT PRIMARY KEY,date TEXT,mealtype TEXT,foodtype TEXT,people_string TEXT); 6 | create table daily_read_log(eid TEXT PRIMARY KEY,date TEXT,readtype TEXT,howlong INTEGER); 7 | create table daily_watchtv_log(eid TEXT PRIMARY KEY,date TEXT,watchtype TEXT,howlong INTEGER); 8 | create table marriages_log(eid TEXT PRIMARY KEY,married_date TEXT,partner_name TEXT,location TEXT); 9 | create table monthly_pet_care_log(eid TEXT PRIMARY KEY,date TEXT,pet_care_type TEXT); 10 | create table moves_log(eid TEXT PRIMARY KEY,date TEXT,type_of_move TEXT, destination TEXT); 11 | create table travel_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,people TEXT); 12 | create table travel_dining_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,dining_date TEXT,food_type TEXT,food_location TEXT,place_visit_date TEXT,place TEXT,people TEXT,action TEXT,emotion TEXT); 13 | create table travel_places_visited_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,place_visit_date TEXT,place TEXT, people TEXT,action TEXT,emotion TEXT); 14 | create table weekly_bakeorcook_log(eid TEXT PRIMARY KEY,date TEXT,cuisine TEXT,location TEXT,people TEXT); 15 | create table weekly_dating_log(eid TEXT PRIMARY KEY,date TEXT,people_string TEXT,location TEXT); 16 | create table weekly_grocery_log(eid TEXT PRIMARY KEY,date TEXT,fruits TEXT,drinks TEXT,toiletries TEXT,people_string TEXT); 17 | create table weekly_hobby_log(eid TEXT PRIMARY KEY,date TEXT,hobbies TEXT,people_string TEXT); 18 | 19 | .mode csv 20 | .import annual_medical_care-log.csv annual_medical_care_log --skip 1 21 | .import daily_meal-log.csv daily_meal_log --skip 1 22 | .import marriages-log.csv marriages_log --skip 1 23 | .import travel_places_visited-log.csv travel_places_visited_log --skip 1 24 | .import weekly_dating-log.csv weekly_dating_log --skip 1 25 | .import daily_chat-log.csv daily_chat_log --skip 1 26 | .import daily_read-log.csv daily_read_log --skip 1 27 | .import monthly_pet_care-log.csv monthly_pet_care_log --skip 1 28 | .import travel-log.csv travel_log --skip 1 29 | .import weekly_grocery-log.csv weekly_grocery_log --skip 1 30 | .import daily_exercise-log.csv daily_exercise_log --skip 1 31 | .import daily_watchtv-log.csv daily_watchtv_log --skip 1 32 | .import moves-log.csv moves_log --skip 1 33 | .import travel_dining-log.csv travel_dining_log --skip 1 34 | .import weekly_bakeorcook-log.csv weekly_bakeorcook_log --skip 1 35 | .import weekly_hobby-log.csv weekly_hobby_log --skip 1 36 | 37 | 38 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/marriages-log.csv: -------------------------------------------------------------------------------- 1 | eid,married_date,partner_name,location 2 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/monthly_pet_care-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,pet_care_type 2 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/moves-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,type_of_move,destination 2 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/timeline.pkl: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6845161880743d8554812b4601fb020a65882be1f85292dc0d50b8c0addc45d4 3 | size 123884505 4 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/travel-log.csv: -------------------------------------------------------------------------------- 1 | eid,start_date,end_date,city,people 2 | e18113,2022/01/02,2022/01/09,"Dubai, UAE","Olivia, Nevaeh, Hazel" 3 | e16597,2021/02/18,2021/02/22,"Rio, Brazil","Emily, Carter, Kayden" 4 | e15113,2020/02/07,2020/02/13,"New Delhi, India","Carter, Andrew, Emily" 5 | e13629,2019/03/10,2019/03/24,"Shanghai, China","Andrew, Kayden, Carter" 6 | e12155,2018/02/27,2018/03/12,"Shanghai, China",Avery 7 | e10647,2017/05/12,2017/05/18,"Bangkok, Thailand",Andrew 8 | e9088,2016/04/12,2016/04/20,"Rio, Brazil","Benjamin, Jackson, Willow" 9 | e7581,2015/04/28,2015/05/11,"Seoul, South Korea",Carter 10 | e6043,2014/01/13,2014/01/23,"Bangkok, Thailand",Piper 11 | e4583,2013/01/20,2013/01/27,"Bangkok, Thailand","Carter, Andrew" 12 | e3045,2012/05/02,2012/05/17,"Sydney, Australia",Piper 13 | e1514,2011/02/14,2011/02/27,"Shanghai, China","Kayden, Emily" 14 | e1,2010/02/12,2010/02/18,"Philadelphia, US","Carter, Kayden" 15 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/travel_dining-log.csv: -------------------------------------------------------------------------------- 1 | eid,start_date,end_date,city,dining_date,food_type,food_location,place_visit_date,place,people,action,emotion 2 | e7,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/13,Chinese food,High Street Philly,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 3 | e8,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/15,Chinese food,High Street Philly,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 4 | e9,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/16,street food,Lunch Street,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 5 | e10,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/17,Japanese food,High Street Philly,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 6 | e11,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/18,Japanese food,Wood Street Pizza,2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 7 | e1515,2011/02/14,2011/02/27,"Shanghai, China",2011/02/15,Italian food,Fangbang Xi Lu,,,,, 8 | e1516,2011/02/14,2011/02/27,"Shanghai, China",2011/02/16,Indian food,Fangbang Xi Lu,,,,, 9 | e1517,2011/02/14,2011/02/27,"Shanghai, China",2011/02/17,Italian food,South Bund Fabric Market,,,,, 10 | e1518,2011/02/14,2011/02/27,"Shanghai, China",2011/02/18,Italian food,Fangbang Xi Lu,,,,, 11 | e1519,2011/02/14,2011/02/27,"Shanghai, China",2011/02/19,street food,South Bund Fabric Market,,,,, 12 | e1520,2011/02/14,2011/02/27,"Shanghai, China",2011/02/20,Japanese food,Yuyuan Lu junction,,,,, 13 | e1521,2011/02/14,2011/02/27,"Shanghai, China",2011/02/22,Indian food,Wanhangdu Lu junction,,,,, 14 | e1522,2011/02/14,2011/02/27,"Shanghai, China",2011/02/23,Chinese food,South Bund Fabric Market,,,,, 15 | e1523,2011/02/14,2011/02/27,"Shanghai, China",2011/02/24,local food,South Bund Fabric Market,,,,, 16 | e1524,2011/02/14,2011/02/27,"Shanghai, China",2011/02/26,Indian food,Yuyuan Lu junction,,,,, 17 | e1525,2011/02/14,2011/02/27,"Shanghai, China",2011/02/27,Chinese food,Fangbang Xi Lu,,,,, 18 | e3049,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/03,Japanese food,Love Crepe,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 19 | e3050,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/05,Italian food,Bombay Street Kitchen,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 20 | e3051,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/06,local food,Bombay Street Kitchen,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 21 | e3052,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/07,street food,Bombay Street Kitchen,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 22 | e3053,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/09,Japanese food,Bombay Street Kitchen,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 23 | e3054,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/10,Chinese food,Bombay Street Kitchen,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 24 | e3055,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/11,Japanese food,Love Crepe,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 25 | e3056,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/12,local food,Thievery Chicken & Charcoal,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 26 | e3057,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/13,Indian food,Bombay Street Kitchen,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 27 | e3058,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/14,street food,Love Crepe,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 28 | e3059,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/15,Italian food,Thievery Chicken & Charcoal,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 29 | e3060,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/16,Italian food,Bombay Street Kitchen,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 30 | e3061,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/17,Japanese food,Bombay Street Kitchen,2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 31 | e4589,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/21,Chinese food,Victory Monument,2013/01/25,Wat Traimit,"Carter, Andrew",took a group photo,impressed 32 | e4590,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/22,Italian food,Victory Monument,2013/01/25,Wat Traimit,"Carter, Andrew",took a group photo,impressed 33 | e4591,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/23,Japanese food,Ratchawat Market,2013/01/25,Wat Traimit,"Carter, Andrew",took a group photo,impressed 34 | e4592,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/25,Indian food,Ratchawat Market,2013/01/25,Wat Traimit,"Carter, Andrew",took a group photo,impressed 35 | e4593,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/26,Indian food,Victory Monument,2013/01/25,Wat Traimit,"Carter, Andrew",took a group photo,impressed 36 | e4594,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/27,Chinese food,Ratchawat Market,2013/01/25,Wat Traimit,"Carter, Andrew",took a group photo,impressed 37 | e6049,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/14,Italian food,Ratchawat Market,2014/01/18,Grand Palace,Piper,bought some souvenirs,special 38 | e6050,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/15,local food,Ratchawat Market,2014/01/18,Grand Palace,Piper,bought some souvenirs,special 39 | e6051,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/17,Japanese food,Ratchawat Market,2014/01/18,Grand Palace,Piper,bought some souvenirs,special 40 | e6052,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/18,Italian food,Yaowarat,2014/01/18,Grand Palace,Piper,bought some souvenirs,special 41 | e6053,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/20,Italian food,Ratchawat Market,2014/01/18,Grand Palace,Piper,bought some souvenirs,special 42 | e6054,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/22,Chinese food,Ratchawat Market,2014/01/18,Grand Palace,Piper,bought some souvenirs,special 43 | e6055,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/23,Chinese food,Yaowarat,2014/01/18,Grand Palace,Piper,bought some souvenirs,special 44 | e7585,2015/04/28,2015/05/11,"Seoul, South Korea",2015/04/30,Chinese food,Seoul Bamdokkaebi Night Market,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 45 | e7586,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/01,street food,Common Ground,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 46 | e7587,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/02,Indian food,Seoul Bamdokkaebi Night Market,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 47 | e7588,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/04,local food,Common Ground,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 48 | e7589,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/06,local food,Seoul Bamdokkaebi Night Market,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 49 | e7590,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/07,Italian food,Myeongdong Street Food Alley,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 50 | e7591,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/08,local food,Seoul Bamdokkaebi Night Market,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 51 | e7592,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/10,Indian food,Common Ground,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 52 | e7593,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/11,Italian food,Myeongdong Street Food Alley,2015/05/01,N Seoul Tower,Carter,recorded some videos,special 53 | e9094,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/13,Japanese food,Bolinho de bacalhau,2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 54 | e9095,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/14,Italian food,Tapioca,2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 55 | e9096,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/15,Japanese food,Bolinho de bacalhau,2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 56 | e9097,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/16,Japanese food,Bolinho de bacalhau,2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 57 | e9098,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/17,Japanese food,Tapioca,2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 58 | e9099,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/18,Italian food,Pão de queijo,2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 59 | e9100,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/19,Chinese food,Bolinho de bacalhau,2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 60 | e9101,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/20,Indian food,Pão de queijo,2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 61 | e10653,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/13,Indian food,Yaowarat,2017/05/17,Grand Palace,Andrew,bought some souvenirs,happy 62 | e10654,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/14,Chinese food,Yaowarat,2017/05/17,Grand Palace,Andrew,bought some souvenirs,happy 63 | e10655,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/17,Italian food,Ratchawat Market,2017/05/17,Grand Palace,Andrew,bought some souvenirs,happy 64 | e10656,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/18,Italian food,Yaowarat,2017/05/17,Grand Palace,Andrew,bought some souvenirs,happy 65 | e12156,2018/02/27,2018/03/12,"Shanghai, China",2018/02/28,Chinese food,Yuyuan Lu junction,,,,, 66 | e12157,2018/02/27,2018/03/12,"Shanghai, China",2018/03/01,Italian food,Wanhangdu Lu junction,,,,, 67 | e12158,2018/02/27,2018/03/12,"Shanghai, China",2018/03/03,Japanese food,Fangbang Xi Lu,,,,, 68 | e12159,2018/02/27,2018/03/12,"Shanghai, China",2018/03/04,Italian food,Wanhangdu Lu junction,,,,, 69 | e12160,2018/02/27,2018/03/12,"Shanghai, China",2018/03/05,street food,South Bund Fabric Market,,,,, 70 | e12161,2018/02/27,2018/03/12,"Shanghai, China",2018/03/08,local food,South Bund Fabric Market,,,,, 71 | e12162,2018/02/27,2018/03/12,"Shanghai, China",2018/03/09,local food,Fangbang Xi Lu,,,,, 72 | e12163,2018/02/27,2018/03/12,"Shanghai, China",2018/03/10,Japanese food,Fangbang Xi Lu,,,,, 73 | e12164,2018/02/27,2018/03/12,"Shanghai, China",2018/03/11,Indian food,Fangbang Xi Lu,,,,, 74 | e12165,2018/02/27,2018/03/12,"Shanghai, China",2018/03/12,local food,South Bund Fabric Market,,,,, 75 | e13630,2019/03/10,2019/03/24,"Shanghai, China",2019/03/12,Japanese food,Wanhangdu Lu junction,,,,, 76 | e13631,2019/03/10,2019/03/24,"Shanghai, China",2019/03/13,Chinese food,South Bund Fabric Market,,,,, 77 | e13632,2019/03/10,2019/03/24,"Shanghai, China",2019/03/15,Italian food,Fangbang Xi Lu,,,,, 78 | e13633,2019/03/10,2019/03/24,"Shanghai, China",2019/03/17,street food,Yuyuan Lu junction,,,,, 79 | e13634,2019/03/10,2019/03/24,"Shanghai, China",2019/03/19,Japanese food,South Bund Fabric Market,,,,, 80 | e13635,2019/03/10,2019/03/24,"Shanghai, China",2019/03/20,local food,Fangbang Xi Lu,,,,, 81 | e13636,2019/03/10,2019/03/24,"Shanghai, China",2019/03/21,Italian food,South Bund Fabric Market,,,,, 82 | e13637,2019/03/10,2019/03/24,"Shanghai, China",2019/03/22,street food,Wanhangdu Lu junction,,,,, 83 | e13638,2019/03/10,2019/03/24,"Shanghai, China",2019/03/23,Italian food,Fangbang Xi Lu,,,,, 84 | e13639,2019/03/10,2019/03/24,"Shanghai, China",2019/03/24,Italian food,Wanhangdu Lu junction,,,,, 85 | e15119,2020/02/07,2020/02/13,"New Delhi, India",2020/02/08,Indian food,Connaught Place,2020/02/12,Lodi Gardens,"Carter, Andrew, Emily",recorded some videos,happy 86 | e15120,2020/02/07,2020/02/13,"New Delhi, India",2020/02/09,local food,Moolchand,2020/02/12,Lodi Gardens,"Carter, Andrew, Emily",recorded some videos,happy 87 | e15121,2020/02/07,2020/02/13,"New Delhi, India",2020/02/11,Italian food,Chawri Bazar,2020/02/12,Lodi Gardens,"Carter, Andrew, Emily",recorded some videos,happy 88 | e15122,2020/02/07,2020/02/13,"New Delhi, India",2020/02/12,street food,Chawri Bazar,2020/02/12,Lodi Gardens,"Carter, Andrew, Emily",recorded some videos,happy 89 | e16603,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/19,Chinese food,Bolinho de bacalhau,2021/02/23,Carnaval,"Emily, Carter, Kayden",took a group photo,impressed 90 | e16604,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/20,Indian food,Tapioca,2021/02/23,Carnaval,"Emily, Carter, Kayden",took a group photo,impressed 91 | e16605,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/21,Italian food,Tapioca,2021/02/23,Carnaval,"Emily, Carter, Kayden",took a group photo,impressed 92 | e16606,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/22,local food,Bolinho de bacalhau,2021/02/23,Carnaval,"Emily, Carter, Kayden",took a group photo,impressed 93 | e18117,2022/01/02,2022/01/09,"Dubai, UAE",2022/01/03,Italian food,Falafel Alzaeem,2022/01/05,Dubai Aquarium & Underwater Zoo,"Olivia, Nevaeh, Hazel",took a group photo,special 94 | e18118,2022/01/02,2022/01/09,"Dubai, UAE",2022/01/04,Indian food,Falafel Alzaeem,2022/01/05,Dubai Aquarium & Underwater Zoo,"Olivia, Nevaeh, Hazel",took a group photo,special 95 | e18119,2022/01/02,2022/01/09,"Dubai, UAE",2022/01/06,Italian food,Falafel Alzaeem,2022/01/05,Dubai Aquarium & Underwater Zoo,"Olivia, Nevaeh, Hazel",took a group photo,special 96 | e18120,2022/01/02,2022/01/09,"Dubai, UAE",2022/01/07,Chinese food,Hor Al Anz Bakery,2022/01/05,Dubai Aquarium & Underwater Zoo,"Olivia, Nevaeh, Hazel",took a group photo,special 97 | e18121,2022/01/02,2022/01/09,"Dubai, UAE",2022/01/08,Italian food,Sind Punjab,2022/01/05,Dubai Aquarium & Underwater Zoo,"Olivia, Nevaeh, Hazel",took a group photo,special 98 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/travel_places_visited-log.csv: -------------------------------------------------------------------------------- 1 | eid,start_date,end_date,city,place_visit_date,place,people,action,emotion 2 | e2,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/13,Liberty Bell,"Carter, Kayden",took a group photo,impressed 3 | e3,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/14,Philadelphia Museum of Art,"Carter, Kayden",recorded some videos,happy 4 | e4,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/15,Ipanema,"Carter, Kayden",bought some souvenirs,happy 5 | e5,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/16,Carnaval,"Carter, Kayden",took a selfie,impressed 6 | e6,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 7 | e3046,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/03,Sydney Opera House,Piper,bought some souvenirs,happy 8 | e3047,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/04,Sydney Harbour Bridge,Piper,bought some souvenirs,impressed 9 | e3048,2012/05/02,2012/05/17,"Sydney, Australia",2012/05/05,Bondi Beach,Piper,recorded some videos,impressed 10 | e4584,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/21,Grand Palace,"Carter, Andrew",recorded some videos,special 11 | e4585,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/22,Wat Arun,"Carter, Andrew",took a group photo,special 12 | e4586,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/23,National Museum & Wang Na Palace,"Carter, Andrew",bought some souvenirs,special 13 | e4587,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/24,Wat Suthat,"Carter, Andrew",took a selfie,impressed 14 | e4588,2013/01/20,2013/01/27,"Bangkok, Thailand",2013/01/25,Wat Traimit,"Carter, Andrew",took a group photo,impressed 15 | e6044,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/14,National Museum & Wang Na Palace,Piper,took a group photo,special 16 | e6045,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/15,Wat Arun,Piper,took a group photo,special 17 | e6046,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/16,Wat Suthat,Piper,took a selfie,special 18 | e6047,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/17,Wat Traimit,Piper,took a group photo,impressed 19 | e6048,2014/01/13,2014/01/23,"Bangkok, Thailand",2014/01/18,Grand Palace,Piper,bought some souvenirs,special 20 | e7582,2015/04/28,2015/05/11,"Seoul, South Korea",2015/04/29,National Museum Of Korea,Carter,took a selfie,impressed 21 | e7583,2015/04/28,2015/05/11,"Seoul, South Korea",2015/04/30,Lotte World Tower,Carter,recorded some videos,happy 22 | e7584,2015/04/28,2015/05/11,"Seoul, South Korea",2015/05/01,N Seoul Tower,Carter,recorded some videos,special 23 | e9089,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/13,Copacabana,"Benjamin, Jackson, Willow",bought some souvenirs,impressed 24 | e9090,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/14,Cristo Redentor,"Benjamin, Jackson, Willow",took a selfie,special 25 | e9091,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/15,Sugarloaf,"Benjamin, Jackson, Willow",took a group photo,special 26 | e9092,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/16,Ipanema,"Benjamin, Jackson, Willow",took a selfie,impressed 27 | e9093,2016/04/12,2016/04/20,"Rio, Brazil",2016/04/17,Carnaval,"Benjamin, Jackson, Willow",took a group photo,special 28 | e10648,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/13,National Museum & Wang Na Palace,Andrew,took a group photo,impressed 29 | e10649,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/14,Wat Suthat,Andrew,took a selfie,happy 30 | e10650,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/15,Wat Traimit,Andrew,took a group photo,impressed 31 | e10651,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/16,Wat Arun,Andrew,took a selfie,happy 32 | e10652,2017/05/12,2017/05/18,"Bangkok, Thailand",2017/05/17,Grand Palace,Andrew,bought some souvenirs,happy 33 | e15114,2020/02/07,2020/02/13,"New Delhi, India",2020/02/08,Gurudwara Bangla Sahib,"Carter, Andrew, Emily",took a group photo,special 34 | e15115,2020/02/07,2020/02/13,"New Delhi, India",2020/02/09,The Lotus Temple,"Carter, Andrew, Emily",took a selfie,happy 35 | e15116,2020/02/07,2020/02/13,"New Delhi, India",2020/02/10,The Red Fort,"Carter, Andrew, Emily",took a group photo,special 36 | e15117,2020/02/07,2020/02/13,"New Delhi, India",2020/02/11,Qutub Minar,"Carter, Andrew, Emily",recorded some videos,impressed 37 | e15118,2020/02/07,2020/02/13,"New Delhi, India",2020/02/12,Lodi Gardens,"Carter, Andrew, Emily",recorded some videos,happy 38 | e16598,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/19,Ipanema,"Emily, Carter, Kayden",took a group photo,happy 39 | e16599,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/20,Sugarloaf,"Emily, Carter, Kayden",bought some souvenirs,special 40 | e16600,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/21,Copacabana,"Emily, Carter, Kayden",recorded some videos,impressed 41 | e16601,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/22,Cristo Redentor,"Emily, Carter, Kayden",took a selfie,happy 42 | e16602,2021/02/18,2021/02/22,"Rio, Brazil",2021/02/23,Carnaval,"Emily, Carter, Kayden",took a group photo,impressed 43 | e18114,2022/01/02,2022/01/09,"Dubai, UAE",2022/01/03,Miracle Garden,"Olivia, Nevaeh, Hazel",recorded some videos,impressed 44 | e18115,2022/01/02,2022/01/09,"Dubai, UAE",2022/01/04,Burj Khalifa,"Olivia, Nevaeh, Hazel",took a group photo,special 45 | e18116,2022/01/02,2022/01/09,"Dubai, UAE",2022/01/05,Dubai Aquarium & Underwater Zoo,"Olivia, Nevaeh, Hazel",took a group photo,special 46 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/views_db.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/PostText/85ba698d2892eae8daeed5ca037079b584d779b2/data/TimelineQA/medium-100/views_db.sqlite -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/views_metadata.txt: -------------------------------------------------------------------------------- 1 | #This file contains meta data about views. 2 | #name: The name of the view, 3 | #description: a text description of what the view contains, 4 | #schema: the schema, 5 | #example queries: examples of questions that may be posed against this view 6 | #additional_context: additional special instructions to pass to codex 7 | #foreign key: optionally foreign keys if available, 8 | #: and a description of each attribute. 9 | 10 | name: annual_medical_care_log 11 | description: different types of medical appointments for myself, my children/kids, or my parents, and when. E.g., I brought my kids for their vision checkup on Jan 03, 2021. 12 | schema: (eid,date,for_whom,type_of_care) 13 | example queries: When was my last vision checkup? How many dental appointments did my kids have in 2020? When did my parents go for their medical checkup in 2021? 14 | additional_context: The for_whom column describes checkups for myself as "personal_medical_checkup". 15 | foreign key: - 16 | eid: TEXT // primary key 17 | date: DATETYPE // the day of the appointment. 18 | for_whom: TEXT // who the medical appointment is for (parents, children, or self) TEXT 19 | type_of_care: TEXT // the type of medical appointment (dental, vision, physical) 20 | 21 | name: daily_chat_log 22 | description: records talks/chats with people on some date and time. E.g., I spent 24 minutes talking to Emily and Bob on the morning of August 6, 2017. 23 | schema: (eid,date,timeofday,howlong,friends) 24 | example queries: When was the last time I chat with Rachel in the morning? How long did I chat with my friends yesterday? Who did I talk to on 12 May, 2018? 25 | additional_context: 26 | foreign key: - 27 | eid: TEXT // primary key 28 | date: DATETYPE // the day the chat/talk took place 29 | timeofday: TEXT // when the chat/talk took place during the day (morning, afternoon, or evening) 30 | howlong: INTEGER // the length/duration of the chat/talk in minutes 31 | friends: TEXT // the list of people whom I talked to 32 | 33 | name: daily_exercise_log 34 | description: records of different types of exercises done (running/jogging, swimming, walking etc.) and the corresponding heart rate. E.g., I went swimming on Jun 20, 2019 and my average heart rate was 145BPM. 35 | schema: (eid,date,exercise,heart_rate) 36 | example queries: how many times did I run or bike last month? Which month did I exercise the most? Which year did I exercise the most? 37 | additional_context: 38 | foreign key: - 39 | eid: TEXT // primary key 40 | date: DATETYPE // the day of exercise 41 | exercise: TEXT // type of exercise (swimming, running/jogging, yoga, walking, etc.) 42 | heart_rate: INTEGER // the average heart rate in BPM during exercise 43 | 44 | name: daily_meal_log 45 | description: records of meals eaten, types of food, friends or people involved, and on which day or date. E.g., I had oatmeal for breakfast on April 7, 2011 with John and Carter. 46 | schema: (eid,date,mealtype,foodtype,people_string) 47 | example queries: How many times did I have cereals for breakfast in April 2020? What did I last eat with Jane for lunch? 48 | additional_context: 49 | foreign key: - 50 | eid: TEXT // primary key 51 | date: DATETYPE // the day of the meal 52 | mealtype: TEXT // type of meal (breakfast, lunch, dinner, snack) 53 | foodtype: TEXT // type of food (chinese, pasta, tacos etc.) 54 | people_string: TEXT // list of people or friends 55 | 56 | name: daily_read_log 57 | description: what is read (e.g., books, news, social media) and for how long 58 | schema: (eid,date,readtype,howlong). E.g., I spent 30 mins reading news on 22 June 2018. 59 | example queries: how much time did I spend on social media or the news last month? How many books did I read in 2020? 60 | additional_context: 61 | foreign key: - 62 | eid: TEXT // primary key 63 | date: DATETYPE // date the reading activity took place 64 | readtype: TEXT // source of reading material (books, news, magazine, social media) 65 | howlong: INTEGER // the length/duration of the reading activity 66 | 67 | name: daily_watchtv_log 68 | description: what is watched on tv (e.g., movie, tv series, documentary, or news), on which day or date and for how long. E.g., I watched a movie for 2 hrs on 18 June 2019. 69 | schema: (eid,date,watchtype,howlong) 70 | example queries: When was the last time I watch a movie or news? How long did I spend watching tv in 2020 71 | additional_context: 72 | foreign key: - 73 | eid: TEXT // primary key 74 | date: DATETYPE // the day where this event, watching tv, occurred 75 | watchtype: TEXT // what is watched on tv (movie, tv series, news) 76 | howlong: INTEGER // the length/duration spent watching tv 77 | 78 | name: marriages_log 79 | description: records the date of marriage, name of spouse or partner, and where the marriage took place. E.g., I married John on May 2, 2010 in Marin County, California. 80 | schema: (eid,married_date,partner_name,location) 81 | example queries: when was my first marriage and where? How many times did I get married? 82 | additional_context: 83 | foreign key: - 84 | eid: TEXT // primary key 85 | married_date: DATETYPE // the date of marriage 86 | partner_name: TEXT // name of partner or spouse 87 | location: TEXT // the location where the marriage took place 88 | 89 | name: monthly_pet_care_log 90 | description: date that the pet (e.g., dog or cat) was taking for grooming or medical checkups. E.g., Roki was groomed and had his nails trimmed on 2 Jan 2022. 91 | schema: (eid,date,pet_care_type) 92 | example queries: When did I last take Rocky to a bath? How many times did Rocky groom and got his nails trimmed in 2021? Did Rocky go for a medical checkup last year? 93 | additional_context: 94 | foreign key: - 95 | eid: TEXT // primary key 96 | date: DATETYPE // the day of the pet care or grooming 97 | pet_care_type: TEXT // grooming (bath, grooming, nail trim) 98 | 99 | name: moves_log 100 | description: when a move or relocation was made and the destination location. E.g., I moved to Madison, Wisconsin for college on 20 August, 2018. 101 | schema: (id,date,type_of_move,destination) 102 | example queries: when did I move to college? 103 | additional_context: 104 | foreign key: - 105 | eid: TEXT // primary key 106 | date: DATETYPE // the day of of the move 107 | type_of_move: TEXT // the type of move or reason for moving (move due to job, college, graduate school) 108 | destination: TEXT // the place moved to 109 | 110 | name: travel_log 111 | description: record of where I traveled, the travel destination, with whom, and the start and end dates of travel. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 with John and Carter. 112 | schema: (eid,start_date,end_date,city,people) 113 | example queries: When did I visit Tokyo in 2021? Who did I go London with in 2021? How long was I in Taipei, Taiwan in 2021? 114 | additional_context: 115 | foreign key: - 116 | eid: TEXT // primary key 117 | start_date: DATETYPE // the first day of travel for this record 118 | end_date: DATETYPE // the last day of travel for this record 119 | city: TEXT // the destination or city traveled to 120 | people: TEXT // the people or friends traveling with you 121 | 122 | name: travel_dining_log 123 | description: records of dining events or meals during travel at the city, the food, the place where the meal took place, the date of the dining event, the people or friends at the dining event, and the emotion associated. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 and had pasta at Pier 39. 124 | schema: (eid,start_date,end_date,city,dining_date,food_type,food_location,place_visit_date,place,people,action,emotion) 125 | example queries: what did I last eat in Philadelphia? Where was the location of the restaurant I dined in the last day of London? 126 | additional_context: 127 | foreign key: (eid,start_date,end_date,city) is a foreign key in travel_log 128 | eid: TEXT // primary key 129 | start_date: DATETYPE // the first day of travel for this record 130 | end_date: DATETYPE // the last day of travel for this record 131 | city: TEXT // the destination or city traveled to 132 | dining_date: DATETYPE // the date this dining event took place 133 | food_type: TEXT // type of food (Chinese, Italian, Indian, Japanese, etc.) 134 | food_location: TEXT // name of restaurant or street name where the meal took place 135 | place_visit_date: DATETYPE // date that place was visited during the same trip 136 | place: TEXT // a place visited during the same trip 137 | people: TEXT // list of people or friends who were at the same trip 138 | action: TEXT // an activity done during at the place that was visited (took a group photo, or a selfie, bought souvenirs) 139 | emotion: TEXT // feelings associated with the action taken (happy, impressed) 140 | 141 | name: travel_places_visited_log 142 | description: the start and end date of the travel, the city visited (e.g., London, Sydney) and with whom and the things done. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 and visited Union Square with John and Carter on September 8, 2019. We took some pictures and were happy. 143 | schema: (eid,start_date,end_date,city,place_visit_date,place,people,action,emotion) 144 | example queries: How many places did I visit when I was in Tokyo in 2021? Did I go to the Museum of Arts when I last visited Philadelphia? 145 | additional_context: 146 | foreign key: (eid,start_date,end_date,city) is a foreign key in travel_log 147 | eid: TEXT // primary key 148 | start_date: DATETYPE // the first day of travel for this record 149 | end_date: DATETYPE // the last day of travel for this record 150 | city: TEXT // the destination or city traveled to 151 | place_visit_date: DATETYPE // date that place was visited during the same trip 152 | place: TEXT // a place visited during the same trip 153 | people: TEXT // list of people or friends who were at the same trip 154 | action: TEXT // an activity done during at the place that was visited (took a group photo, or a selfie, bought souvenirs) 155 | emotion: TEXT // feelings associated with the action taken (happy, impressed) 156 | 157 | name: weekly_bakeorcook_log 158 | description: records the type of dishes or cuisines I make (e.g., dessert, pie, jam, cookies), where it was made and with whom and the day it was made. E.g., I baked chocolate cake at my place with Amy and Brandy on February 6, 2019. 159 | schema: (eid,date,cuisine,location,people) 160 | example queries: When did I last bake a pie? What dishes did I cook the most often in 2021? Who made a chocolate cake with me in April 2022? How many times did I make bread in 2022? 161 | additional_context: 162 | foreign key: - 163 | eid: TEXT // primary key 164 | date: DATETYPE // the day the baking or cooking took place 165 | cuisine: TEXT // the type of dish made (chocolate chip, cake, steak, chinese stir fry) 166 | location: TEXT // the place where was the dish made. Usually it is "my place" 167 | people: TEXT // the list of people or friends' names 168 | 169 | name: weekly_dating_log 170 | description: records of dating events, including the name of the date and the location where the dating took place. E.g., I dated Jimmy on May 3, 2018 at Filoli Gardens. 171 | schema: (eid,date,people_string,location) 172 | example queries: where did I spend time with Avery in 2022? 173 | additional_context: 174 | foreign key: - 175 | eid: TEXT // primary key 176 | date: DATETYPE // the day when the dating event happened 177 | people_string: TEXT // the people in the dating event 178 | location: TEXT // the location of the dating event 179 | 180 | name: weekly_grocery_log 181 | description: records of the fruits, drinks, and toiletries shopped and bought during a certain day, and the people involved in the same grocery shopping trip. E.g., I bought strawberries and bananas, milk, and toothpaste from the supermarket with Jimmy and Carter. 182 | schema: (eid,date,fruits,drinks,toiletries,people_string) 183 | example queries: How many trips did I make to the supermarket in April 2021? When did I last buy toothpaste? How many times did I buy fruits in May 2020? 184 | additional_context: 185 | foreign key: - 186 | eid: TEXT // primary key 187 | date: DATETYPE // the day the groceries were purchased 188 | fruits: TEXT // fruits (apples, peaches, guava, bananas, etc.) 189 | drinks: TEXT // drinks (mango juice, soda, milk, water, etc.) 190 | toiletries: TEXT // toiletries (toothpaste, facial/body/mouth wash, facial/body/hand lotion etc.) 191 | people_string: TEXT // the people or friends who were also there for this shopping event 192 | 193 | name: weekly_hobby_log 194 | description: records which hobbies were carried out during a certain day and the people involved. What did I do? What did I do on a certain day and with whom? E.g., I meditated with John on January 15, 2017. 195 | schema: (eid,date,hobbies,people_string) 196 | example queries: How many times did I meditate in 2021? How many times did I work out in May 2021? 197 | additional_context: 198 | foreign key: - 199 | eid: TEXT // primary key 200 | date: DATETYPE // the day the hobby was done 201 | hobbies: TEXT // an activity that is carried out regularly (meditation, yoga, jogging, working out) 202 | people_string: TEXT // the people or friends who were together for this hobby 203 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/weekly_bakeorcook-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,cuisine,location,people 2 | e6097,2014/04/26,carrot cake,my place,"Piper, Nora, Rylee, Piper" 3 | e6106,2014/05/26,turkey shepherd’s pie,my place,"Carter, Andrew" 4 | e6109,2014/06/09,"chrissy teigen’s 3-ingredient chocolate mousse, birthday cupcakes with white wine buttercream",my place,"Andrew, Kayden" 5 | e6123,2014/07/14,"brownies, peanut butter cookies",my place,"Emily, Kayden, Andrew" 6 | e6142,2014/09/22,"carrot cake, cranberry apple danish, vegan sugar cookies",my place,Hazel 7 | e6165,2014/12/02,blackberry-raspberry skillet cobbler,my place,"Carter, Kayden" 8 | e6173,2014/12/21,blackberry jam pie-crust straws,my place,"Kayden, Emily" 9 | e7609,2015/02/03,"indian red lentil, scallion pancake",my place,"Emily, Kayden" 10 | e7610,2015/02/01,"carrot cake, peanut butter cookies",my place,"Emily, Carter" 11 | e7614,2015/02/16,"cranberry apple danish, blackberry jam pie-crust straws, chocolate-chip mug brownie",my place,"Emily, Carter" 12 | e7619,2015/02/22,"chocolate chip cookie in a mug, giant cinnamon roll",my place,Piper 13 | e7635,2015/03/30,"blackberry jam pie-crust straws, blackberry-raspberry skillet cobbler",my place,Carter 14 | e7652,2015/05/14,"air-fryer brats, cheesy ham chowder",my place,"Rylee, Olivia" 15 | e7657,2015/05/22,"slow-cooker pork loin, cube steak and gravy, traditional meat loaf",my place,"Nora, Piper, Hazel" 16 | e7664,2015/06/25,thai noodle salad,my place,"Jackson, Benjamin, Willow" 17 | e7670,2015/07/13,homemade toaster pastries,my place,"Kayden, Andrew" 18 | e7687,2015/09/07,split pea soup with ham & jalapeno,my place,Jackson 19 | e7693,2015/09/27,"au gratin peas and potatoes, split pea soup with ham & jalapeno, sushi",my place,"Avery, Kinsley, Piper" 20 | e7701,2015/10/10,"crockpot spareribs, chicken cordon bleu skillet",my place,"Willow, Jackson, Avery" 21 | e7709,2015/11/16,easy peanut butter fudge,my place,"Avery, Lydia" 22 | e9119,2016/02/15,"naan bread, cashew chicken ",my place,"Andrew, Carter, Emily" 23 | e9127,2016/03/05,"general tso’s chicken, contest-winning broccoli chicken casserole",my place,Rylee 24 | e9135,2016/03/20,"cheater’s mini rhubarb galettes, lemon meringue cookies",my place,"Carter, Emily, Kayden" 25 | e9138,2016/03/31,"cheesy ham chowder, chinese broccoli with oyster sauce, shrimp quesadilla",my place,"Claire, Olivia" 26 | e9145,2016/04/26,brown sugar-pear puff pastries,my place,"Emily, Kayden, Carter, Andrew" 27 | e9146,2016/05/01,"easy peanut butter fudge, giant cinnamon roll",my place,"Andrew, Kayden, Carter" 28 | e9150,2016/05/16,fig tarte tatin,my place,Avery 29 | e9164,2016/06/29,"chinese chicken wings, healthy turkey chili",my place,"Emily, Carter, Andrew" 30 | e9172,2016/07/09,"brownies, birthday cupcakes with white wine buttercream",my place,"Hazel, Layla" 31 | e9173,2016/07/11,easy cherry skillet cake,my place,"Olivia, Piper, Avery" 32 | e9179,2016/07/24,"crockpot spareribs, cheesy ham chowder, instant pot whole chicken",my place,"Piper, Nora, Rylee, Olivia" 33 | e9186,2016/08/08,"easy peanut butter fudge, blackberry-raspberry skillet cobbler, brown sugar-pear puff pastries",my place,"Avery, Lydia, Piper, Eva" 34 | e9216,2016/11/21,"cheater’s mini rhubarb galettes, birthday cupcakes with white wine buttercream",my place,Emily 35 | e9227,2016/12/16,split pea soup with ham & jalapeno,my place,Jackson 36 | e10660,2017/01/13,"air-fryer brats, swedish meatball recipe",my place,"Kayden, Andrew" 37 | e10685,2017/03/08,cream of celery soup recipe,my place,"Kayden, Emily, Carter, Andrew" 38 | e10738,2017/08/10,"cream-filled bundt cake, blackberry jam pie-crust straws",my place,"Lydia, Avery, Kinsley" 39 | e10760,2017/10/23,chinese broccoli with oyster sauce,my place,Kayden 40 | e10764,2017/11/11,"hamburger stroganoff, favorite chicken potpie, ramen noodle stir-fry",my place,Willow 41 | e10775,2017/12/07,macaroni and cheese,my place,"Avery, Benjamin, Willow, Jackson" 42 | e10777,2017/12/12,cinnamon sheet cake with cider frosting,my place,"Carter, Andrew, Kayden, Emily" 43 | e10781,2017/12/26,"blackberry jam pie-crust straws, blackberry-raspberry skillet cobbler",my place,"Claire, Olivia, Piper" 44 | e12177,2018/02/07,"chocolate-chip mug brownie, carrot cake",my place,"Emily, Andrew, Carter" 45 | e12207,2018/05/20,"homemade toaster pastries, cinnamon sheet cake with cider frosting, easy chocolate marshmallow cups",my place,"Nevaeh, Nora, Rylee, Olivia" 46 | e12226,2018/07/09,beef and broccoli,my place,"Nevaeh, Nora, Avery" 47 | e12272,2018/11/25,"healthy turkey chili, so-easy sloppy joes",my place,"Emily, Kayden, Andrew, Carter" 48 | e13655,2019/01/25,"peanut butter cookies, chrissy teigen’s 3-ingredient chocolate mousse",my place,"Kayden, Emily" 49 | e13678,2019/04/17,"sushi, chicken and gravy",my place,"Layla, Claire, Olivia, Kinsley" 50 | e13686,2019/05/23,"easy peanut butter fudge, peanut butter cookies",my place,"Claire, Layla, Olivia, Hazel" 51 | e13702,2019/07/09,"cashew chicken , rigatoni with sausage & peas",my place,"Andrew, Kayden, Carter, Emily" 52 | e13703,2019/07/12,"naan bread, thai green curry paste, asian slaw",my place,Emily 53 | e13709,2019/08/02,"ground turkey vegetable soup, general tso’s chicken, contest-winning broccoli chicken casserole",my place,"Layla, Nevaeh, Kinsley" 54 | e13712,2019/08/10,"poke, chicken cordon bleu skillet",my place,"Olivia, Nevaeh" 55 | e13717,2019/08/13,"easy peanut butter fudge, homemade toaster pastries",my place,"Kayden, Andrew, Emily, Carter" 56 | e13746,2019/11/23,"carrot cake, brownies",my place,"Avery, Jackson, Willow" 57 | e15156,2020/03/22,ground turkey vegetable soup,my place,"Carter, Kayden" 58 | e15173,2020/05/15,"birthday cupcakes with white wine buttercream, easy chocolate marshmallow cups, blackberry-raspberry skillet cobbler",my place,"Andrew, Carter" 59 | e15179,2020/06/15,"tender salsa beef, healthy turkey chili, thai noodle salad",my place,Nevaeh 60 | e15193,2020/07/29,chicken and gravy,my place,"Kayden, Emily" 61 | e15204,2020/08/31,"rigatoni with sausage & peas, turkey shepherd’s pie, lo mein",my place,"Benjamin, Jackson, Willow" 62 | e15205,2020/08/26,cream-filled bundt cake,my place,"Emily, Carter, Andrew, Kayden" 63 | e15212,2020/09/28,"chinese broccoli with oyster sauce, vietnamese coffee, so-easy sloppy joes",my place,"Jackson, Avery, Benjamin, Willow" 64 | e15218,2020/10/09,"chicken and gravy, indian red lentil",my place,"Eva, Rylee, Lydia" 65 | e16616,2021/01/16,"easy peanut butter fudge, homemade toaster pastries",my place,Andrew 66 | e16627,2021/02/12,"cinnamon sheet cake with cider frosting, gluten-free apple rose tart",my place,"Jackson, Avery, Willow" 67 | e16628,2021/02/17,"giant cinnamon roll, carrot cake, easy peanut butter fudge",my place,"Willow, Jackson" 68 | e16634,2021/02/27,easy chocolate marshmallow cups,my place,"Piper, Nora, Eva, Avery" 69 | e16650,2021/04/24,brownies,my place,"Olivia, Rylee, Nevaeh" 70 | e16683,2021/08/01,"cashew chicken , general tso’s chicken, lo mein",my place,"Andrew, Carter" 71 | e16690,2021/09/02,"lemon meringue cookies, birthday cupcakes with white wine buttercream",my place,"Nora, Lydia, Nevaeh" 72 | e16704,2021/10/21,"blackberry jam pie-crust straws, fig tarte tatin, cheater’s mini rhubarb galettes",my place,Layla 73 | e16710,2021/11/04,"blackberry-raspberry skillet cobbler, lemon meringue cookies",my place,"Piper, Avery, Claire, Olivia" 74 | e18158,2022/04/17,"homemade toaster pastries, brown sugar-pear puff pastries",my place,"Carter, Emily, Andrew, Kayden" 75 | e18163,2022/05/03,swedish meatball recipe,my place,"Eva, Kinsley" 76 | e18174,2022/06/03,"chocolate chip cookie in a mug, easy chocolate marshmallow cups, blackberry-raspberry skillet cobbler",my place,"Andrew, Carter, Emily" 77 | e18186,2022/06/26,"chow mein, cheesy ham chowder",my place,"Andrew, Kayden, Emily" 78 | e18192,2022/07/12,lemon meringue cookies,my place,"Kayden, Carter, Emily, Andrew" 79 | e18225,2022/10/09,"cranberry apple danish, cinnamon sheet cake with cider frosting",my place,"Carter, Andrew, Emily" 80 | e18226,2022/10/21,"creamed garden potatoes and peas, general tso’s chicken",my place,"Piper, Kinsley, Layla, Piper" 81 | e18236,2022/11/14,"dessert nachos, cranberry apple danish, gluten-free apple rose tart",my place,"Rylee, Piper" 82 | e18242,2022/11/30,"cream-filled bundt cake, fig tarte tatin, chocolate chip cookie in a mug",my place,"Emily, Carter" 83 | e18250,2022/12/30,"contest-winning broccoli chicken casserole, au gratin peas and potatoes",my place,"Jackson, Benjamin, Willow" 84 | -------------------------------------------------------------------------------- /data/TimelineQA/medium-100/weekly_hobby-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,hobbies,people_string 2 | e18,2010/01/05,meditation, 3 | e20,2010/01/14,yoga, 4 | e24,2010/01/26,gardening, 5 | e26,2010/02/04,working out, 6 | e34,2010/03/04,learning a language,Avery 7 | e36,2010/03/05,learning a language, 8 | e37,2010/03/11,gardening, 9 | e40,2010/03/14,learning a language, 10 | e47,2010/04/05,gardening,Kayden 11 | e48,2010/04/15,yoga, 12 | e51,2010/04/25,meditation, 13 | e52,2010/04/26,meditation,Nevaeh 14 | e55,2010/05/09,meditation, 15 | e56,2010/05/11,learning a language, 16 | e63,2010/06/06,gardening, 17 | e64,2010/06/08,learning a language, 18 | e67,2010/06/17,meditation,Jackson 19 | e68,2010/06/25,gardening, 20 | e70,2010/07/02,yoga,"Kayden, Carter" 21 | e78,2010/08/11,working out,Rylee 22 | e81,2010/08/13,learning a language, 23 | e85,2010/08/20,gardening,"Benjamin, Jackson, Avery" 24 | e87,2010/08/27,learning a language,"Kayden, Emily, Andrew" 25 | e91,2010/09/13,learning a language, 26 | e95,2010/09/20,meditation, 27 | e102,2010/10/11,working out,"Jackson, Avery" 28 | e105,2010/10/15,learning a language, 29 | e112,2010/11/05,learning a language, 30 | e115,2010/11/13,meditation,Piper 31 | e121,2010/12/15,learning a language, 32 | e1531,2011/01/06,meditation,"Emily, Andrew, Carter" 33 | e1532,2011/01/11,learning a language,Piper 34 | e1534,2011/01/29,working out, 35 | e1548,2011/03/17,working out,Jackson 36 | e1555,2011/04/02,working out,"Emily, Andrew" 37 | e1556,2011/04/08,learning a language, 38 | e1570,2011/05/09,yoga,"Benjamin, Willow, Avery" 39 | e1575,2011/05/28,gardening, 40 | e1576,2011/06/03,yoga, 41 | e1581,2011/06/14,learning a language, 42 | e1587,2011/06/30,gardening,"Andrew, Carter, Emily" 43 | e1591,2011/07/03,working out, 44 | e1594,2011/07/10,meditation,Carter 45 | e1597,2011/07/16,yoga, 46 | e1598,2011/07/21,working out, 47 | e1601,2011/07/29,meditation, 48 | e1604,2011/08/05,gardening, 49 | e1608,2011/08/06,learning a language,"Willow, Benjamin" 50 | e1623,2011/10/18,working out, 51 | e1626,2011/10/22,working out,"Emily, Carter" 52 | e1627,2011/10/28,meditation, 53 | e1633,2011/12/01,gardening, 54 | e1644,2011/12/18,learning a language, 55 | e3083,2012/02/23,meditation, 56 | e3087,2012/02/28,learning a language, 57 | e3088,2012/02/29,learning a language,Olivia 58 | e3092,2012/03/04,working out, 59 | e3097,2012/03/27,gardening, 60 | e3105,2012/05/20,meditation, 61 | e3116,2012/06/29,yoga,Nora 62 | e3120,2012/07/01,yoga, 63 | e3121,2012/07/04,learning a language,"Andrew, Carter, Kayden" 64 | e3125,2012/07/15,gardening,"Avery, Jackson" 65 | e3130,2012/07/30,yoga,"Kayden, Andrew, Emily" 66 | e3135,2012/08/14,learning a language, 67 | e3136,2012/08/16,yoga, 68 | e3141,2012/08/28,meditation, 69 | e3146,2012/09/25,working out,Emily 70 | e3158,2012/11/10,gardening, 71 | e3165,2012/11/27,working out, 72 | e3166,2012/11/28,yoga, 73 | e3169,2012/12/08,meditation,Andrew 74 | e3171,2012/12/13,learning a language, 75 | e4600,2013/01/06,working out, 76 | e4603,2013/01/08,yoga,"Carter, Andrew, Emily" 77 | e4604,2013/01/13,learning a language, 78 | e4607,2013/01/29,working out, 79 | e4609,2013/02/10,learning a language, 80 | e4616,2013/03/12,working out, 81 | e4620,2013/03/24,meditation, 82 | e4624,2013/03/31,yoga, 83 | e4634,2013/05/02,gardening,"Carter, Kayden, Emily" 84 | e4639,2013/05/27,yoga,"Willow, Jackson, Avery" 85 | e4642,2013/06/08,gardening, 86 | e4656,2013/07/30,meditation, 87 | e4660,2013/08/12,learning a language, 88 | e4668,2013/09/17,working out,"Benjamin, Jackson" 89 | e4674,2013/10/21,yoga,Kayden 90 | e4679,2013/11/04,meditation,Carter 91 | e4685,2013/11/19,gardening,Claire 92 | e4686,2013/11/22,yoga, 93 | e4697,2013/12/30,meditation, 94 | e6060,2014/01/01,working out, 95 | e6064,2014/01/21,gardening, 96 | e6067,2014/01/25,working out, 97 | e6077,2014/02/19,working out,"Carter, Emily" 98 | e6079,2014/02/26,yoga, 99 | e6082,2014/03/13,meditation, 100 | e6086,2014/03/21,yoga,"Emily, Andrew, Kayden" 101 | e6090,2014/04/04,gardening, 102 | e6091,2014/04/08,meditation, 103 | e6093,2014/04/13,gardening,"Kayden, Andrew, Carter" 104 | e6100,2014/05/10,learning a language,Benjamin 105 | e6104,2014/05/15,meditation, 106 | e6116,2014/06/23,yoga,"Emily, Carter, Kayden" 107 | e6120,2014/07/03,learning a language, 108 | e6121,2014/07/06,working out,"Nora, Avery, Layla" 109 | e6133,2014/08/20,working out,Carter 110 | e6134,2014/08/23,meditation,Carter 111 | e6137,2014/08/30,meditation,"Olivia, Nora, Layla" 112 | e6139,2014/09/07,meditation, 113 | e6149,2014/10/08,learning a language,Claire 114 | e6152,2014/10/15,yoga, 115 | e6157,2014/10/30,meditation,Claire 116 | e6159,2014/11/11,learning a language,"Benjamin, Avery" 117 | e6167,2014/12/05,meditation,"Eva, Hazel, Piper" 118 | e6168,2014/12/08,meditation, 119 | e6177,2014/12/31,meditation, 120 | e7598,2015/01/05,yoga, 121 | e7608,2015/01/26,working out, 122 | e7617,2015/02/15,gardening, 123 | e7620,2015/02/25,meditation, 124 | e7624,2015/03/01,yoga, 125 | e7628,2015/03/08,gardening, 126 | e7630,2015/03/18,learning a language, 127 | e7637,2015/03/28,gardening, 128 | e7647,2015/05/03,gardening,Kayden 129 | e7659,2015/05/21,working out,Andrew 130 | e7661,2015/06/02,working out, 131 | e7671,2015/07/15,gardening, 132 | e7674,2015/07/25,yoga, 133 | e7676,2015/08/04,meditation, 134 | e7680,2015/08/14,learning a language,Andrew 135 | e7688,2015/09/09,working out, 136 | e7690,2015/09/15,yoga,"Rylee, Hazel, Piper" 137 | e7697,2015/10/03,meditation, 138 | e7698,2015/10/06,meditation,"Carter, Emily, Kayden" 139 | e7703,2015/10/17,gardening,"Kayden, Emily" 140 | e7705,2015/10/24,yoga, 141 | e7706,2015/11/04,working out, 142 | e7711,2015/11/18,yoga,"Benjamin, Jackson, Avery" 143 | e7719,2015/12/04,meditation, 144 | e7729,2015/12/28,meditation,Kayden 145 | e9107,2016/01/13,meditation,"Emily, Kayden" 146 | e9110,2016/01/26,working out, 147 | e9112,2016/02/03,yoga,"Avery, Willow, Jackson" 148 | e9117,2016/02/05,gardening,Carter 149 | e9124,2016/02/26,yoga, 150 | e9129,2016/03/07,learning a language, 151 | e9132,2016/03/13,learning a language,Eva 152 | e9137,2016/03/18,learning a language, 153 | e9140,2016/04/05,yoga, 154 | e9142,2016/04/11,gardening, 155 | e9148,2016/05/02,gardening, 156 | e9149,2016/05/06,working out,"Andrew, Emily" 157 | e9154,2016/05/21,working out,"Kayden, Andrew, Emily" 158 | e9156,2016/05/30,gardening,"Carter, Emily" 159 | e9160,2016/06/07,working out, 160 | e9167,2016/06/27,meditation, 161 | e9170,2016/07/06,learning a language, 162 | e9175,2016/07/10,gardening, 163 | e9181,2016/07/23,gardening, 164 | e9189,2016/08/15,meditation, 165 | e9191,2016/08/23,learning a language,Carter 166 | e9199,2016/09/20,working out, 167 | e9203,2016/09/23,yoga, 168 | e9208,2016/10/26,meditation, 169 | e9213,2016/11/10,working out,Eva 170 | e9221,2016/12/06,working out,Nevaeh 171 | e9229,2016/12/20,meditation, 172 | e10674,2017/02/05,gardening,"Carter, Andrew" 173 | e10675,2017/02/08,working out, 174 | e10679,2017/02/17,learning a language,Kinsley 175 | e10689,2017/03/16,yoga, 176 | e10692,2017/03/21,working out,Olivia 177 | e10694,2017/03/30,learning a language,"Carter, Kayden" 178 | e10696,2017/04/08,gardening, 179 | e10699,2017/04/14,learning a language, 180 | e10702,2017/04/17,yoga, 181 | e10707,2017/05/01,gardening, 182 | e10711,2017/05/10,learning a language,"Kayden, Andrew, Carter" 183 | e10720,2017/06/16,yoga,Eva 184 | e10727,2017/07/02,meditation,"Andrew, Kayden, Emily" 185 | e10730,2017/07/10,working out, 186 | e10736,2017/08/02,working out,"Avery, Layla, Piper" 187 | e10740,2017/08/16,working out, 188 | e10751,2017/09/30,working out,"Rylee, Hazel, Layla" 189 | e10753,2017/10/01,gardening,"Andrew, Carter" 190 | e10757,2017/10/20,yoga, 191 | e10768,2017/11/18,meditation,"Layla, Eva" 192 | e10771,2017/11/19,working out, 193 | e10772,2017/11/24,meditation,"Jackson, Avery" 194 | e10780,2017/12/17,gardening, 195 | e10783,2017/12/30,working out, 196 | e12183,2018/02/20,learning a language,"Carter, Emily" 197 | e12188,2018/03/06,working out, 198 | e12195,2018/03/21,learning a language, 199 | e12199,2018/04/05,working out,"Lydia, Piper" 200 | e12203,2018/04/26,meditation,"Kayden, Carter, Emily" 201 | e12209,2018/05/16,yoga,Nora 202 | e12215,2018/06/10,working out, 203 | e12223,2018/06/25,gardening, 204 | e12229,2018/07/10,working out,"Emily, Kayden, Carter" 205 | e12234,2018/08/12,learning a language, 206 | e12236,2018/08/15,yoga, 207 | e12237,2018/08/19,gardening, 208 | e12250,2018/09/17,yoga,Carter 209 | e12258,2018/10/10,learning a language, 210 | e12261,2018/10/15,yoga, 211 | e12264,2018/10/24,learning a language, 212 | e12265,2018/11/03,learning a language,"Rylee, Claire, Nora" 213 | e12267,2018/11/07,yoga, 214 | e12268,2018/11/10,working out,"Jackson, Benjamin, Avery" 215 | e12270,2018/11/17,learning a language, 216 | e12282,2018/12/30,gardening, 217 | e12283,2018/12/31,meditation,"Carter, Emily" 218 | e13648,2019/01/11,yoga, 219 | e13659,2019/02/11,gardening,"Kayden, Emily" 220 | e13662,2019/02/15,yoga, 221 | e13665,2019/03/02,gardening,"Benjamin, Avery" 222 | e13675,2019/03/30,yoga, 223 | e13681,2019/05/02,yoga, 224 | e13684,2019/05/13,meditation, 225 | e13689,2019/06/01,meditation,Andrew 226 | e13706,2019/07/27,gardening,Eva 227 | e13720,2019/08/13,gardening, 228 | e13721,2019/08/17,learning a language, 229 | e13727,2019/08/28,gardening, 230 | e13729,2019/09/06,learning a language, 231 | e13731,2019/09/12,learning a language, 232 | e13733,2019/09/24,yoga, 233 | e13736,2019/10/05,gardening, 234 | e13739,2019/10/14,gardening,"Jackson, Willow" 235 | e13742,2019/10/18,gardening,"Emily, Andrew, Kayden" 236 | e13744,2019/11/01,meditation, 237 | e13750,2019/12/01,learning a language, 238 | e13752,2019/12/06,meditation, 239 | e13755,2019/12/13,learning a language,Kayden 240 | e13758,2019/12/18,gardening, 241 | e13759,2019/12/22,gardening, 242 | e15134,2020/01/11,yoga,Andrew 243 | e15137,2020/01/25,learning a language, 244 | e15139,2020/01/31,meditation, 245 | e15148,2020/02/25,yoga,"Claire, Kinsley" 246 | e15150,2020/02/26,learning a language,"Carter, Kayden, Andrew" 247 | e15158,2020/03/25,learning a language, 248 | e15172,2020/05/08,meditation,"Emily, Carter, Andrew" 249 | e15180,2020/06/12,yoga,Rylee 250 | e15189,2020/07/12,learning a language, 251 | e15206,2020/08/27,meditation, 252 | e15208,2020/09/05,gardening, 253 | e15211,2020/09/16,learning a language,"Andrew, Kayden, Emily" 254 | e15213,2020/09/23,meditation,"Rylee, Nevaeh" 255 | e15226,2020/11/04,learning a language,"Emily, Andrew, Kayden" 256 | e15227,2020/11/07,learning a language,"Jackson, Avery" 257 | e15236,2020/12/06,yoga, 258 | e15239,2020/12/11,working out,"Emily, Carter, Kayden" 259 | e15240,2020/12/14,meditation,"Hazel, Kinsley, Eva" 260 | e15244,2020/12/16,yoga,Jackson 261 | e16612,2021/01/05,meditation,"Emily, Andrew" 262 | e16617,2021/01/17,learning a language, 263 | e16618,2021/01/21,gardening, 264 | e16623,2021/02/05,learning a language,"Kayden, Andrew" 265 | e16624,2021/02/08,yoga, 266 | e16635,2021/02/28,meditation,"Andrew, Emily, Kayden" 267 | e16645,2021/04/11,working out, 268 | e16648,2021/04/18,meditation, 269 | e16649,2021/04/21,yoga, 270 | e16652,2021/04/29,gardening,"Benjamin, Avery, Jackson" 271 | e16661,2021/06/02,meditation, 272 | e16663,2021/06/06,gardening, 273 | e16664,2021/06/10,working out, 274 | e16667,2021/06/14,yoga, 275 | e16670,2021/06/24,working out, 276 | e16673,2021/07/06,meditation,Avery 277 | e16676,2021/07/13,learning a language, 278 | e16681,2021/07/27,yoga,"Carter, Andrew" 279 | e16684,2021/08/03,working out, 280 | e16687,2021/08/11,meditation,"Layla, Piper, Hazel" 281 | e16689,2021/08/23,gardening,Benjamin 282 | e16695,2021/09/19,learning a language,Andrew 283 | e16705,2021/10/18,working out,"Andrew, Kayden, Carter" 284 | e16717,2021/11/21,working out,Kayden 285 | e16719,2021/12/09,working out,"Jackson, Benjamin, Avery" 286 | e16721,2021/12/11,meditation,Jackson 287 | e18137,2022/01/25,working out, 288 | e18140,2022/01/31,meditation, 289 | e18141,2022/02/15,gardening,"Layla, Avery, Piper" 290 | e18142,2022/02/19,working out,"Benjamin, Jackson" 291 | e18143,2022/02/25,meditation,"Benjamin, Jackson" 292 | e18145,2022/03/03,meditation, 293 | e18154,2022/04/02,learning a language, 294 | e18157,2022/04/12,gardening, 295 | e18167,2022/05/10,meditation, 296 | e18171,2022/05/16,yoga, 297 | e18179,2022/06/06,yoga,Olivia 298 | e18184,2022/06/21,working out, 299 | e18187,2022/06/25,gardening, 300 | e18188,2022/06/29,yoga, 301 | e18199,2022/08/05,meditation,"Andrew, Emily" 302 | e18201,2022/08/08,working out, 303 | e18206,2022/08/22,learning a language, 304 | e18207,2022/08/24,yoga, 305 | e18211,2022/09/02,gardening, 306 | e18214,2022/09/08,yoga,Layla 307 | e18218,2022/09/12,gardening, 308 | e18219,2022/09/23,meditation, 309 | e18222,2022/09/29,working out,Carter 310 | e18243,2022/11/27,gardening, 311 | e18245,2022/12/08,learning a language,"Emily, Andrew" 312 | e18251,2022/12/28,meditation, 313 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/annual_medical_care-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,for_whom,type_of_care 2 | e7721,2022/10/13,child_medical_care,annual vision checkup 3 | e7720,2022/08/09,child_medical_care,annual dental cleaning and checkup 4 | e7719,2022/02/28,child_medical_care,annual dental cleaning and checkup 5 | e7718,2022/09/09,child_medical_care,annual physical checkup 6 | e7717,2022/10/16,parent_medical_care,annual dental cleaning and checkup 7 | e7716,2022/11/20,parent_medical_care,annual physical checkup 8 | e7715,2022/02/26,personal_medical_care,annual physical checkup 9 | e7067,2021/02/11,child_medical_care,annual physical checkup 10 | e7066,2021/10/28,child_medical_care,annual dental cleaning and checkup 11 | e7065,2021/03/24,child_medical_care,annual physical checkup 12 | e7064,2021/10/27,parent_medical_care,annual dental cleaning and checkup 13 | e7063,2021/10/22,parent_medical_care,annual physical checkup 14 | e7062,2021/08/21,personal_medical_care,annual vision checkup 15 | e7061,2021/09/11,personal_medical_care,annual physical checkup 16 | e6424,2020/03/27,child_medical_care,annual physical checkup 17 | e6423,2020/03/02,parent_medical_care,annual physical checkup 18 | e6422,2020/06/13,personal_medical_care,annual dental cleaning and checkup 19 | e6421,2020/06/16,personal_medical_care,annual physical checkup 20 | e5741,2019/12/25,child_medical_care,annual physical checkup 21 | e5740,2019/12/02,parent_medical_care,annual dental cleaning and checkup 22 | e5739,2019/03/20,parent_medical_care,annual physical checkup 23 | e5738,2019/10/13,personal_medical_care,annual dental cleaning and checkup 24 | e5737,2019/03/07,personal_medical_care,annual physical checkup 25 | e5113,2018/07/14,parent_medical_care,annual dental cleaning and checkup 26 | e5112,2018/11/08,parent_medical_care,annual physical checkup 27 | e5111,2018/04/25,personal_medical_care,annual physical checkup 28 | e4466,2017/08/23,parent_medical_care,annual vision checkup 29 | e4465,2017/05/28,parent_medical_care,annual physical checkup 30 | e4464,2017/01/15,personal_medical_care,annual physical checkup 31 | e3825,2016/10/11,parent_medical_care,annual dental cleaning and checkup 32 | e3824,2016/11/26,parent_medical_care,annual physical checkup 33 | e3823,2016/05/25,personal_medical_care,annual vision checkup 34 | e3822,2016/12/11,personal_medical_care,annual physical checkup 35 | e3166,2015/03/20,parent_medical_care,annual dental cleaning and checkup 36 | e3165,2015/07/08,parent_medical_care,annual physical checkup 37 | e3164,2015/10/08,personal_medical_care,annual dental cleaning and checkup 38 | e2517,2014/07/24,parent_medical_care,annual dental cleaning and checkup 39 | e2516,2014/01/20,personal_medical_care,annual vision checkup 40 | e2515,2014/12/25,personal_medical_care,annual dental cleaning and checkup 41 | e1886,2013/07/17,parent_medical_care,annual physical checkup 42 | e1885,2013/11/20,personal_medical_care,annual dental cleaning and checkup 43 | e1884,2013/06/27,personal_medical_care,annual physical checkup 44 | e1250,2012/11/25,parent_medical_care,annual dental cleaning and checkup 45 | e1249,2012/07/11,parent_medical_care,annual physical checkup 46 | e1248,2012/04/03,personal_medical_care,annual dental cleaning and checkup 47 | e1247,2012/09/18,personal_medical_care,annual physical checkup 48 | e613,2011/07/04,parent_medical_care,annual dental cleaning and checkup 49 | e612,2011/03/27,parent_medical_care,annual physical checkup 50 | e611,2011/01/20,personal_medical_care,annual dental cleaning and checkup 51 | e610,2011/09/03,personal_medical_care,annual physical checkup 52 | e15,2010/01/18,parent_medical_care,annual dental cleaning and checkup 53 | e14,2010/07/16,parent_medical_care,annual physical checkup 54 | e13,2010/09/28,personal_medical_care,annual dental cleaning and checkup 55 | e12,2010/08/20,personal_medical_care,annual physical checkup 56 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/config.ini: -------------------------------------------------------------------------------- 1 | [embedding_model] 2 | model = text-embedding-ada-002 3 | encoding = cl100k_base 4 | max_tokens = 8000 5 | 6 | [Views] 7 | model_name = gpt-3.5-turbo 8 | 9 | [RAG] 10 | qa_model = gpt-3.5-turbo 11 | temperature = 0 12 | topk = 10 13 | 14 | [rag_prompt] 15 | prompt = "Use the following pieces of context and general knowledge to answer the question at the end. If the question cannot be answered with the context, ignore the context and answer with general knowledge. If you don't know the answer, just say that you don't know, don't try to make up an answer. \n\n{context}\n\nQuestion: {question} \nAnswer:" 16 | 17 | [sql_prompt] 18 | prompt = # Table name: {tablename} 19 | # Table schema: {schema} 20 | # Table description: {table_desc} 21 | # 22 | # Example rows: 23 | # 24 | # 25 | {example} 26 | # 27 | # Given the above table, schema, and description, write an aggregate SQLite query as necessary to answer the question below. The format of dates is in YYYY/MM/DD. For a range between two dates d1 and d2, use 'BETWEEN d1 and d2'. {additional_context} Avoid using the attribute eid and use single quotes for strings. If an SQL query cannot be generated, please say 'Sorry, no result.' 28 | # 29 | # {question} 30 | SELECT 31 | 32 | [input] 33 | source_idx = timeline.pkl 34 | views_db = views_db.sqlite 35 | views_metadata = views_metadata.txt 36 | views_metadata_idx = views_idx.csv 37 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/create_db.sql: -------------------------------------------------------------------------------- 1 | create table annual_medical_care_log(eid TEXT PRIMARY KEY,date TEXT,for_whom TEXT,type_of_care TEXT); 2 | create table daily_chat_log(eid TEXT PRIMARY KEY,date TEXT,timeofday TEXT,howlong INTEGER,friends TEXT); 3 | create table daily_exercise_log(eid TEXT PRIMARY KEY,date TEXT,exercise TEXT,heart_rate INTEGER); 4 | create table daily_meal_log(eid TEXT PRIMARY KEY,date TEXT,mealtype TEXT,foodtype TEXT,people_string TEXT); 5 | create table daily_read_log(eid TEXT PRIMARY KEY,date TEXT,readtype TEXT,howlong INTEGER); 6 | create table daily_watchtv_log(eid TEXT PRIMARY KEY,date TEXT,watchtype TEXT,howlong INTEGER); 7 | create table marriages_log(eid TEXT PRIMARY KEY,married_date TEXT,partner_name TEXT,location TEXT); 8 | create table monthly_pet_care_log(eid TEXT PRIMARY KEY,date TEXT,pet_care_type TEXT); 9 | create table moves_log(eid TEXT PRIMARY KEY,date TEXT,type_of_move TEXT, destination TEXT); 10 | create table travel_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,people TEXT); 11 | create table travel_dining_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,dining_date TEXT,food_type TEXT,food_location TEXT,place_visit_date TEXT,place TEXT,people TEXT,action TEXT,emotion TEXT); 12 | create table travel_places_visited_log(eid TEXT PRIMARY KEY,start_date TEXT,end_date TEXT,city TEXT,place_visit_date TEXT,place TEXT, people TEXT,action TEXT,emotion TEXT); 13 | create table weekly_bakeorcook_log(eid TEXT PRIMARY KEY,date TEXT,cuisine TEXT,location TEXT,people TEXT); 14 | create table weekly_dating_log(eid TEXT PRIMARY KEY,date TEXT,people_string TEXT,location TEXT); 15 | create table weekly_grocery_log(eid TEXT PRIMARY KEY,date TEXT,fruits TEXT,drinks TEXT,toiletries TEXT,people_string TEXT); 16 | create table weekly_hobby_log(eid TEXT PRIMARY KEY,date TEXT,hobbies TEXT,people_string TEXT); 17 | 18 | .mode csv 19 | .import annual_medical_care-log.csv annual_medical_care_log --skip 1 20 | .import daily_meal-log.csv daily_meal_log --skip 1 21 | .import marriages-log.csv marriages_log --skip 1 22 | .import travel_places_visited-log.csv travel_places_visited_log --skip 1 23 | .import weekly_dating-log.csv weekly_dating_log --skip 1 24 | .import daily_chat-log.csv daily_chat_log --skip 1 25 | .import daily_read-log.csv daily_read_log --skip 1 26 | .import monthly_pet_care-log.csv monthly_pet_care_log --skip 1 27 | .import travel-log.csv travel_log --skip 1 28 | .import weekly_grocery-log.csv weekly_grocery_log --skip 1 29 | .import daily_exercise-log.csv daily_exercise_log --skip 1 30 | .import daily_watchtv-log.csv daily_watchtv_log --skip 1 31 | .import moves-log.csv moves_log --skip 1 32 | .import travel_dining-log.csv travel_dining_log --skip 1 33 | .import weekly_bakeorcook-log.csv weekly_bakeorcook_log --skip 1 34 | .import weekly_hobby-log.csv weekly_hobby_log --skip 1 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/marriages-log.csv: -------------------------------------------------------------------------------- 1 | eid,married_date,partner_name,location 2 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/monthly_pet_care-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,pet_care_type 2 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/moves-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,type_of_move,destination 2 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/timeline.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/PostText/85ba698d2892eae8daeed5ca037079b584d779b2/data/TimelineQA/sparse-100/timeline.pkl -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/timelinedb_sparse.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/PostText/85ba698d2892eae8daeed5ca037079b584d779b2/data/TimelineQA/sparse-100/timelinedb_sparse.sqlite -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/travel-log.csv: -------------------------------------------------------------------------------- 1 | eid,start_date,end_date,city,people 2 | e7710,2022/02/22,2022/02/28,"Shanghai, China","Emily, Carter" 3 | e7048,2021/02/07,2021/02/19,"Dubai, UAE","Emily, Carter" 4 | e6408,2020/05/02,2020/05/12,"Miami, US","Emily, Andrew" 5 | e5724,2019/03/19,2019/03/27,"Rio, Brazil","Eva, Olivia" 6 | e5095,2018/02/09,2018/02/22,"Bangkok, Thailand","Kayden, Carter, Emily" 7 | e4449,2017/03/05,2017/03/16,"Paris, France","Andrew, Emily" 8 | e3805,2016/05/07,2016/05/20,"London, UK",Andrew 9 | e3151,2015/03/03,2015/03/15,"Shanghai, China",Benjamin 10 | e2506,2014/01/23,2014/01/29,"Sydney, Australia","Emily, Carter, Andrew" 11 | e1867,2013/02/06,2013/02/19,"Philadelphia, US","Emily, Carter" 12 | e1231,2012/03/02,2012/03/17,"Bangkok, Thailand",Andrew 13 | e593,2011/05/08,2011/05/22,"London, UK","Benjamin, Avery" 14 | e1,2010/02/12,2010/02/18,"Philadelphia, US","Carter, Kayden" 15 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/travel_places_visited-log.csv: -------------------------------------------------------------------------------- 1 | eid,start_date,end_date,city,place_visit_date,place,people,action,emotion 2 | e2,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/13,Liberty Bell,"Carter, Kayden",took a group photo,impressed 3 | e3,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/14,Philadelphia Museum of Art,"Carter, Kayden",recorded some videos,happy 4 | e4,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/15,Ipanema,"Carter, Kayden",bought some souvenirs,happy 5 | e5,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/16,Carnaval,"Carter, Kayden",took a selfie,impressed 6 | e6,2010/02/12,2010/02/18,"Philadelphia, US",2010/02/17,Independence Hall,"Carter, Kayden",recorded some videos,happy 7 | e594,2011/05/08,2011/05/22,"London, UK",2011/05/09,Tower of London,"Benjamin, Avery",took a group photo,happy 8 | e595,2011/05/08,2011/05/22,"London, UK",2011/05/10,London Eye,"Benjamin, Avery",bought some souvenirs,special 9 | e596,2011/05/08,2011/05/22,"London, UK",2011/05/11,Westminster,"Benjamin, Avery",took a selfie,special 10 | e597,2011/05/08,2011/05/22,"London, UK",2011/05/12,Camden,"Benjamin, Avery",recorded some videos,happy 11 | e598,2011/05/08,2011/05/22,"London, UK",2011/05/13,Hyde Park,"Benjamin, Avery",took a selfie,special 12 | e1232,2012/03/02,2012/03/17,"Bangkok, Thailand",2012/03/03,Wat Traimit,Andrew,bought some souvenirs,happy 13 | e1233,2012/03/02,2012/03/17,"Bangkok, Thailand",2012/03/04,Wat Arun,Andrew,took a selfie,impressed 14 | e1234,2012/03/02,2012/03/17,"Bangkok, Thailand",2012/03/05,Grand Palace,Andrew,took a selfie,happy 15 | e1235,2012/03/02,2012/03/17,"Bangkok, Thailand",2012/03/06,National Museum & Wang Na Palace,Andrew,took a selfie,impressed 16 | e1236,2012/03/02,2012/03/17,"Bangkok, Thailand",2012/03/07,Wat Suthat,Andrew,took a group photo,happy 17 | e1868,2013/02/06,2013/02/19,"Philadelphia, US",2013/02/07,Philadelphia Museum of Art,"Emily, Carter",took a group photo,special 18 | e1869,2013/02/06,2013/02/19,"Philadelphia, US",2013/02/08,Liberty Bell,"Emily, Carter",bought some souvenirs,special 19 | e1870,2013/02/06,2013/02/19,"Philadelphia, US",2013/02/09,Carnaval,"Emily, Carter",recorded some videos,happy 20 | e1871,2013/02/06,2013/02/19,"Philadelphia, US",2013/02/10,Ipanema,"Emily, Carter",recorded some videos,happy 21 | e1872,2013/02/06,2013/02/19,"Philadelphia, US",2013/02/11,Independence Hall,"Emily, Carter",took a group photo,happy 22 | e2507,2014/01/23,2014/01/29,"Sydney, Australia",2014/01/24,Sydney Opera House,"Emily, Carter, Andrew",took a group photo,happy 23 | e2508,2014/01/23,2014/01/29,"Sydney, Australia",2014/01/25,Bondi Beach,"Emily, Carter, Andrew",recorded some videos,special 24 | e2509,2014/01/23,2014/01/29,"Sydney, Australia",2014/01/26,Sydney Harbour Bridge,"Emily, Carter, Andrew",took a selfie,happy 25 | e3806,2016/05/07,2016/05/20,"London, UK",2016/05/08,Westminster,Andrew,took a group photo,happy 26 | e3807,2016/05/07,2016/05/20,"London, UK",2016/05/09,Hyde Park,Andrew,took a group photo,special 27 | e3808,2016/05/07,2016/05/20,"London, UK",2016/05/10,Camden,Andrew,took a group photo,impressed 28 | e3809,2016/05/07,2016/05/20,"London, UK",2016/05/11,London Eye,Andrew,recorded some videos,happy 29 | e3810,2016/05/07,2016/05/20,"London, UK",2016/05/12,Tower of London,Andrew,bought some souvenirs,special 30 | e4450,2017/03/05,2017/03/16,"Paris, France",2017/03/06,Champs Elysées,"Andrew, Emily",bought some souvenirs,impressed 31 | e4451,2017/03/05,2017/03/16,"Paris, France",2017/03/07,Montmartre,"Andrew, Emily",recorded some videos,happy 32 | e4452,2017/03/05,2017/03/16,"Paris, France",2017/03/08,Louvre Museum,"Andrew, Emily",took a selfie,special 33 | e4453,2017/03/05,2017/03/16,"Paris, France",2017/03/09,Eiffel Tower,"Andrew, Emily",took a selfie,special 34 | e4454,2017/03/05,2017/03/16,"Paris, France",2017/03/10,Notre Dame Cathedral,"Andrew, Emily",bought some souvenirs,impressed 35 | e5096,2018/02/09,2018/02/22,"Bangkok, Thailand",2018/02/10,Grand Palace,"Kayden, Carter, Emily",took a selfie,impressed 36 | e5097,2018/02/09,2018/02/22,"Bangkok, Thailand",2018/02/11,Wat Suthat,"Kayden, Carter, Emily",bought some souvenirs,special 37 | e5098,2018/02/09,2018/02/22,"Bangkok, Thailand",2018/02/12,National Museum & Wang Na Palace,"Kayden, Carter, Emily",took a selfie,special 38 | e5099,2018/02/09,2018/02/22,"Bangkok, Thailand",2018/02/13,Wat Traimit,"Kayden, Carter, Emily",bought some souvenirs,impressed 39 | e5100,2018/02/09,2018/02/22,"Bangkok, Thailand",2018/02/14,Wat Arun,"Kayden, Carter, Emily",bought some souvenirs,happy 40 | e5725,2019/03/19,2019/03/27,"Rio, Brazil",2019/03/20,Sugarloaf,"Eva, Olivia",took a selfie,special 41 | e5726,2019/03/19,2019/03/27,"Rio, Brazil",2019/03/21,Ipanema,"Eva, Olivia",took a group photo,happy 42 | e5727,2019/03/19,2019/03/27,"Rio, Brazil",2019/03/22,Carnaval,"Eva, Olivia",took a selfie,happy 43 | e5728,2019/03/19,2019/03/27,"Rio, Brazil",2019/03/23,Copacabana,"Eva, Olivia",recorded some videos,special 44 | e5729,2019/03/19,2019/03/27,"Rio, Brazil",2019/03/24,Cristo Redentor,"Eva, Olivia",took a group photo,impressed 45 | e6409,2020/05/02,2020/05/12,"Miami, US",2020/05/03,Miami Beach,"Emily, Andrew",took a group photo,impressed 46 | e6410,2020/05/02,2020/05/12,"Miami, US",2020/05/04,Vizcaya Museum and Gardens,"Emily, Andrew",bought some souvenirs,impressed 47 | e6411,2020/05/02,2020/05/12,"Miami, US",2020/05/05,South Beach,"Emily, Andrew",bought some souvenirs,special 48 | e6412,2020/05/02,2020/05/12,"Miami, US",2020/05/06,Art Deco Historic District,"Emily, Andrew",took a group photo,happy 49 | e7049,2021/02/07,2021/02/19,"Dubai, UAE",2021/02/08,Miracle Garden,"Emily, Carter",took a group photo,special 50 | e7050,2021/02/07,2021/02/19,"Dubai, UAE",2021/02/09,Dubai Aquarium & Underwater Zoo,"Emily, Carter",took a group photo,happy 51 | e7051,2021/02/07,2021/02/19,"Dubai, UAE",2021/02/10,Burj Khalifa,"Emily, Carter",bought some souvenirs,impressed 52 | e77100,2022/02/22,2022/02/28,"Shanghai, China",2022/02/22,"Shanghai, China","Emily, Carter","sightseeing",impressed 53 | e31510,2015/03/03,2015/03/15,"Shanghai, China",2015/03/03,"Shanghai, China","Benjamin","sightseeing",impressed 54 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/views_db.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/PostText/85ba698d2892eae8daeed5ca037079b584d779b2/data/TimelineQA/sparse-100/views_db.sqlite -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/views_metadata.txt: -------------------------------------------------------------------------------- 1 | #This file contains meta data about views. 2 | #name: The name of the view, 3 | #description: a text description of what the view contains, 4 | #schema: the schema, 5 | #example queries: examples of questions that may be posed against this view 6 | #additional_context: additional special instructions to pass to codex 7 | #foreign key: optionally foreign keys if available, 8 | #: and a description of each attribute. 9 | 10 | name: annual_medical_care_log 11 | description: different types of medical appointments for myself, my children/kids, or my parents, and when. E.g., I brought my kids for their vision checkup on Jan 03, 2021. 12 | schema: (eid,date,for_whom,type_of_care) 13 | example queries: When was my last vision checkup? How many dental appointments did my kids have in 2020? When did my parents go for their medical checkup in 2021? 14 | additional_context: The for_whom column describes checkups for myself as "personal_medical_checkup". 15 | foreign key: - 16 | eid: TEXT // primary key 17 | date: DATETYPE // the day of the appointment. 18 | for_whom: TEXT // who the medical appointment is for (parents, children, or self) TEXT 19 | type_of_care: TEXT // the type of medical appointment (dental, vision, physical) 20 | 21 | name: daily_chat_log 22 | description: records talks/chats with people on some date and time. E.g., I spent 24 minutes talking to Emily and Bob on the morning of August 6, 2017. 23 | schema: (eid,date,timeofday,howlong,friends) 24 | example queries: When was the last time I chat with Rachel in the morning? How long did I chat with my friends yesterday? Who did I talk to on 12 May, 2018? 25 | additional_context: 26 | foreign key: - 27 | eid: TEXT // primary key 28 | date: DATETYPE // the day the chat/talk took place 29 | timeofday: TEXT // when the chat/talk took place during the day (morning, afternoon, or evening) 30 | howlong: INTEGER // the length/duration of the chat/talk in minutes 31 | friends: TEXT // the list of people whom I talked to 32 | 33 | name: daily_exercise_log 34 | description: records of different types of exercises done (running/jogging, swimming, walking etc.) and the corresponding heart rate. E.g., I went swimming on Jun 20, 2019 and my average heart rate was 145BPM. 35 | schema: (eid,date,exercise,heart_rate) 36 | example queries: how many times did I run or bike last month? Which month did I exercise the most? Which year did I exercise the most? 37 | additional_context: 38 | foreign key: - 39 | eid: TEXT // primary key 40 | date: DATETYPE // the day of exercise 41 | exercise: TEXT // type of exercise (swimming, running/jogging, yoga, walking, etc.) 42 | heart_rate: INTEGER // the average heart rate in BPM during exercise 43 | 44 | name: daily_meal_log 45 | description: records of meals eaten, types of food, friends or people involved, and on which day or date. E.g., I had oatmeal for breakfast on April 7, 2011 with John and Carter. 46 | schema: (eid,date,mealtype,foodtype,people_string) 47 | example queries: How many times did I have cereals for breakfast in April 2020? What did I last eat with Jane for lunch? 48 | additional_context: 49 | foreign key: - 50 | eid: TEXT // primary key 51 | date: DATETYPE // the day of the meal 52 | mealtype: TEXT // type of meal (breakfast, lunch, dinner, snack) 53 | foodtype: TEXT // type of food (chinese, pasta, tacos etc.) 54 | people_string: TEXT // list of people or friends 55 | 56 | name: daily_read_log 57 | description: what is read (e.g., books, news, social media) and for how long 58 | schema: (eid,date,readtype,howlong). E.g., I spent 30 mins reading news on 22 June 2018. 59 | example queries: how much time did I spend on social media or the news last month? How many books did I read in 2020? 60 | additional_context: 61 | foreign key: - 62 | eid: TEXT // primary key 63 | date: DATETYPE // date the reading activity took place 64 | readtype: TEXT // source of reading material (books, news, magazine, social media) 65 | howlong: INTEGER // the length/duration of the reading activity 66 | 67 | name: daily_watchtv_log 68 | description: what is watched on tv (e.g., movie, tv series, documentary, or news), on which day or date and for how long. E.g., I watched a movie for 2 hrs on 18 June 2019. 69 | schema: (eid,date,watchtype,howlong) 70 | example queries: When was the last time I watch a movie or news? How long did I spend watching tv in 2020 71 | additional_context: 72 | foreign key: - 73 | eid: TEXT // primary key 74 | date: DATETYPE // the day where this event, watching tv, occurred 75 | watchtype: TEXT // what is watched on tv (movie, tv series, news) 76 | howlong: INTEGER // the length/duration spent watching tv 77 | 78 | name: marriages_log 79 | description: records the date of marriage, name of spouse or partner, and where the marriage took place. E.g., I married John on May 2, 2010 in Marin County, California. 80 | schema: (eid,married_date,partner_name,location) 81 | example queries: when was my first marriage and where? How many times did I get married? 82 | additional_context: 83 | foreign key: - 84 | eid: TEXT // primary key 85 | married_date: DATETYPE // the date of marriage 86 | partner_name: TEXT // name of partner or spouse 87 | location: TEXT // the location where the marriage took place 88 | 89 | name: monthly_pet_care_log 90 | description: date that the pet (e.g., dog or cat) was taking for grooming or medical checkups. E.g., Roki was groomed and had his nails trimmed on 2 Jan 2022. 91 | schema: (eid,date,pet_care_type) 92 | example queries: When did I last take Rocky to a bath? How many times did Rocky groom and got his nails trimmed in 2021? Did Rocky go for a medical checkup last year? 93 | additional_context: 94 | foreign key: - 95 | eid: TEXT // primary key 96 | date: DATETYPE // the day of the pet care or grooming 97 | pet_care_type: TEXT // grooming (bath, grooming, nail trim) 98 | 99 | name: moves_log 100 | description: when a move or relocation was made and the destination location. E.g., I moved to Madison, Wisconsin for college on 20 August, 2018. 101 | schema: (id,date,type_of_move,destination) 102 | example queries: when did I move to college? 103 | additional_context: 104 | foreign key: - 105 | eid: TEXT // primary key 106 | date: DATETYPE // the day of of the move 107 | type_of_move: TEXT // the type of move or reason for moving (move due to job, college, graduate school) 108 | destination: TEXT // the place moved to 109 | 110 | name: travel_log 111 | description: record of where I traveled, the travel destination, with whom, and the start and end dates of travel. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 with John and Carter. 112 | schema: (eid,start_date,end_date,city,people) 113 | example queries: When did I visit Tokyo in 2021? Who did I go London with in 2021? How long was I in Taipei, Taiwan in 2021? 114 | additional_context: 115 | foreign key: - 116 | eid: TEXT // primary key 117 | start_date: DATETYPE // the first day of travel for this record 118 | end_date: DATETYPE // the last day of travel for this record 119 | city: TEXT // the destination or city traveled to 120 | people: TEXT // the people or friends traveling with you 121 | 122 | name: travel_dining_log 123 | description: records of dining events or meals during travel at the city, the food, the place where the meal took place, the date of the dining event, the people or friends at the dining event, and the emotion associated. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 and had pasta at Pier 39. 124 | schema: (eid,start_date,end_date,city,dining_date,food_type,food_location,place_visit_date,place,people,action,emotion) 125 | example queries: what did I last eat in Philadelphia? Where was the location of the restaurant I dined in the last day of London? 126 | additional_context: 127 | foreign key: (eid,start_date,end_date,city) is a foreign key in travel_log 128 | eid: TEXT // primary key 129 | start_date: DATETYPE // the first day of travel for this record 130 | end_date: DATETYPE // the last day of travel for this record 131 | city: TEXT // the destination or city traveled to 132 | dining_date: DATETYPE // the date this dining event took place 133 | food_type: TEXT // type of food (Chinese, Italian, Indian, Japanese, etc.) 134 | food_location: TEXT // name of restaurant or street name where the meal took place 135 | place_visit_date: DATETYPE // date that place was visited during the same trip 136 | place: TEXT // a place visited during the same trip 137 | people: TEXT // list of people or friends who were at the same trip 138 | action: TEXT // an activity done during at the place that was visited (took a group photo, or a selfie, bought souvenirs) 139 | emotion: TEXT // feelings associated with the action taken (happy, impressed) 140 | 141 | name: travel_places_visited_log 142 | description: the start and end date of the travel, the city visited (e.g., London, Sydney) and with whom and the things done. E.g., I went to San Francisco from September 7, 2019 to September 17, 2019 and visited Union Square with John and Carter on September 8, 2019. We took some pictures and were happy. 143 | schema: (eid,start_date,end_date,city,place_visit_date,place,people,action,emotion) 144 | example queries: How many places did I visit when I was in Tokyo in 2021? Did I go to the Museum of Arts when I last visited Philadelphia? 145 | additional_context: 146 | foreign key: (eid,start_date,end_date,city) is a foreign key in travel_log 147 | eid: TEXT // primary key 148 | start_date: DATETYPE // the first day of travel for this record 149 | end_date: DATETYPE // the last day of travel for this record 150 | city: TEXT // the destination or city traveled to 151 | place_visit_date: DATETYPE // date that place was visited during the same trip 152 | place: TEXT // a place visited during the same trip 153 | people: TEXT // list of people or friends who were at the same trip 154 | action: TEXT // an activity done during at the place that was visited (took a group photo, or a selfie, bought souvenirs) 155 | emotion: TEXT // feelings associated with the action taken (happy, impressed) 156 | 157 | name: weekly_bakeorcook_log 158 | description: records the type of dishes or cuisines I make (e.g., dessert, pie, jam, cookies), where it was made and with whom and the day it was made. E.g., I baked chocolate cake at my place with Amy and Brandy on February 6, 2019. 159 | schema: (eid,date,cuisine,location,people) 160 | example queries: When did I last bake a pie? What dishes did I cook the most often in 2021? Who made a chocolate cake with me in April 2022? How many times did I make bread in 2022? 161 | additional_context: 162 | foreign key: - 163 | eid: TEXT // primary key 164 | date: DATETYPE // the day the baking or cooking took place 165 | cuisine: TEXT // the type of dish made (chocolate chip, cake, steak, chinese stir fry) 166 | location: TEXT // the place where was the dish made. Usually it is "my place" 167 | people: TEXT // the list of people or friends' names 168 | 169 | name: weekly_dating_log 170 | description: records of dating events, including the name of the date and the location where the dating took place. E.g., I dated Jimmy on May 3, 2018 at Filoli Gardens. 171 | schema: (eid,date,people_string,location) 172 | example queries: where did I spend time with Avery in 2022? 173 | additional_context: 174 | foreign key: - 175 | eid: TEXT // primary key 176 | date: DATETYPE // the day when the dating event happened 177 | people_string: TEXT // the people in the dating event 178 | location: TEXT // the location of the dating event 179 | 180 | name: weekly_grocery_log 181 | description: records of the fruits, drinks, and toiletries shopped and bought during a certain day, and the people involved in the same grocery shopping trip. E.g., I bought strawberries and bananas, milk, and toothpaste from the supermarket with Jimmy and Carter. 182 | schema: (eid,date,fruits,drinks,toiletries,people_string) 183 | example queries: How many trips did I make to the supermarket in April 2021? When did I last buy toothpaste? How many times did I buy fruits in May 2020? 184 | additional_context: 185 | foreign key: - 186 | eid: TEXT // primary key 187 | date: DATETYPE // the day the groceries were purchased 188 | fruits: TEXT // fruits (apples, peaches, guava, bananas, etc.) 189 | drinks: TEXT // drinks (mango juice, soda, milk, water, etc.) 190 | toiletries: TEXT // toiletries (toothpaste, facial/body/mouth wash, facial/body/hand lotion etc.) 191 | people_string: TEXT // the people or friends who were also there for this shopping event 192 | 193 | name: weekly_hobby_log 194 | description: records which hobbies were carried out during a certain day and the people involved. What did I do? What did I do on a certain day and with whom? E.g., I meditated with John on January 15, 2017. 195 | schema: (eid,date,hobbies,people_string) 196 | example queries: How many times did I meditate in 2021? How many times did I work out in May 2021? 197 | additional_context: 198 | foreign key: - 199 | eid: TEXT // primary key 200 | date: DATETYPE // the day the hobby was done 201 | hobbies: TEXT // an activity that is carried out regularly (meditation, yoga, jogging, working out) 202 | people_string: TEXT // the people or friends who were together for this hobby 203 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/weekly_bakeorcook-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,cuisine,location,people 2 | e2522,2014/02/02,"easy chocolate marshmallow cups, chocolate-chip mug brownie, birthday cupcakes with white wine buttercream",my place,"Andrew, Kayden, Carter, Emily" 3 | e2524,2014/02/05,"brownies, chocolate chip cookie in a mug, cinnamon sheet cake with cider frosting",my place,Willow 4 | e2527,2014/02/21,fig tarte tatin,my place,Piper 5 | e2538,2014/04/05,"chinese broccoli with oyster sauce, crockpot spareribs",my place,Andrew 6 | e2539,2014/04/03,"dessert nachos, gluten-free apple rose tart",my place,"Jackson, Benjamin, Avery" 7 | e2550,2014/06/08,"blackberry jam pie-crust straws, cinnamon sheet cake with cider frosting",my place,"Carter, Andrew" 8 | e2559,2014/07/11,turkey shepherd’s pie,my place,"Benjamin, Willow" 9 | e2569,2014/08/31,"au gratin peas and potatoes, vietnamese coffee",my place,"Andrew, Emily, Carter, Kayden" 10 | e2587,2014/12/10,asian slaw,my place,"Avery, Benjamin" 11 | e3222,2015/11/19,"gluten-free apple rose tart, fig tarte tatin, birthday cupcakes with white wine buttercream",my place,"Piper, Olivia, Kinsley, Hazel" 12 | e3829,2016/01/28,"cinnamon sheet cake with cider frosting, cranberry apple danish, giant cinnamon roll",my place,"Andrew, Carter, Emily" 13 | e3834,2016/02/01,"peanut butter cookies, blackberry jam pie-crust straws, easy chocolate marshmallow cups",my place,Avery 14 | e3848,2016/03/30,contest-winning broccoli chicken casserole,my place,"Andrew, Emily, Carter" 15 | e3851,2016/04/28,hamburger stroganoff,my place,"Rylee, Claire" 16 | e3854,2016/05/05,"cream-filled bundt cake, easy cherry skillet cake",my place,"Andrew, Kayden, Emily, Carter" 17 | e3861,2016/06/02,"cream-filled bundt cake, brownies, chocolate skillet cake",my place,"Lydia, Claire, Rylee, Piper" 18 | e3869,2016/07/17,"asian slaw, thai noodle salad, thai green curry paste",my place,"Nora, Layla, Rylee" 19 | e3877,2016/08/28,"cube steak and gravy, scallion pancake, gado gado",my place,"Nora, Hazel, Layla" 20 | e3881,2016/09/19,chrissy teigen’s 3-ingredient chocolate mousse,my place,"Kayden, Emily, Andrew" 21 | e3893,2016/11/16,"lemon meringue cookies, blackberry-raspberry skillet cobbler, chocolate skillet cake",my place,"Carter, Emily, Andrew" 22 | e4474,2017/01/25,"au gratin peas and potatoes, air-fryer brats, wonton soup",my place,"Carter, Emily, Andrew, Kayden" 23 | e4478,2017/01/30,so-easy sloppy joes,my place,"Carter, Kayden" 24 | e4480,2017/02/17,"carrot cake, chocolate-chip mug brownie",my place,Emily 25 | e4497,2017/06/22,"easy cherry skillet cake, lemon meringue cookies",my place,"Willow, Jackson, Benjamin" 26 | e4498,2017/07/06,"chocolate chip cookie in a mug, easy cherry skillet cake",my place,Willow 27 | e4513,2017/09/08,"peanut butter cookies, giant cinnamon roll, pistachio oat squares",my place,Emily 28 | e4528,2017/11/16,contest-winning broccoli chicken casserole,my place,"Kayden, Andrew, Carter, Emily" 29 | e4533,2017/12/07,"vegan sugar cookies, lemon meringue cookies, birthday cupcakes with white wine buttercream",my place,"Andrew, Emily, Kayden, Carter" 30 | e5123,2018/02/24,"swedish meatball recipe, chicken cordon bleu skillet",my place,Andrew 31 | e5139,2018/05/02,"broccoli-stuffed chicken, lo mein, gado gado",my place,"Carter, Andrew" 32 | e5143,2018/05/27,blackberry-raspberry skillet cobbler,my place,Lydia 33 | e5153,2018/07/04,"peanut butter cookies, chocolate chip cookie in a mug, carrot cake",my place,"Jackson, Willow, Benjamin" 34 | e5168,2018/09/08,"chinese vegetable stir-fry, vietnamese coffee, cube steak and gravy",my place,"Eva, Piper" 35 | e5746,2019/01/20,chocolate skillet cake,my place,"Emily, Andrew, Carter" 36 | e5748,2019/02/11,"indian red lentil, air-fryer brats",my place,"Emily, Carter, Andrew" 37 | e5761,2019/03/30,"blackberry-raspberry skillet cobbler, cheater’s mini rhubarb galettes, chocolate skillet cake",my place,"Carter, Kayden" 38 | e5763,2019/04/15,fig tarte tatin,my place,"Benjamin, Jackson, Avery, Willow" 39 | e5774,2019/06/17,asian slaw,my place,Piper 40 | e5777,2019/06/29,"chinese chicken wings, thai noodle salad, split pea soup with ham & jalapeno",my place,"Kayden, Carter" 41 | e5799,2019/10/06,"gluten-free apple rose tart, chocolate chip cookie in a mug, homemade toaster pastries",my place,"Nevaeh, Layla" 42 | e5809,2019/11/16,"swedish meatball recipe, scallion pancake, chicken parmesan spaghetti",my place,"Claire, Piper, Lydia" 43 | e5810,2019/11/18,"blackberry-raspberry skillet cobbler, giant cinnamon roll, birthday cupcakes with white wine buttercream",my place,Kayden 44 | e6485,2020/11/03,"cheesy ham chowder, chinese broccoli with oyster sauce, shrimp quesadilla",my place,"Claire, Olivia" 45 | e7084,2021/03/19,poke,my place,"Andrew, Emily" 46 | e7128,2021/11/14,"cube steak and gravy, poke",my place,Kayden 47 | e7134,2021/12/12,"carrot cake, chocolate skillet cake, cranberry apple danish",my place,"Avery, Olivia, Kinsley" 48 | e7746,2022/05/01,brownies,my place,Eva 49 | e7754,2022/06/23,lemon meringue cookies,my place,"Kayden, Carter" 50 | e7769,2022/08/22,cinnamon sheet cake with cider frosting,my place,"Carter, Andrew, Kayden, Emily" 51 | e7786,2022/11/28,"cream-filled bundt cake, chocolate-chip mug brownie",my place,"Kayden, Emily" 52 | e7788,2022/12/05,"brownies, chocolate chip cookie in a mug, fig tarte tatin",my place,"Eva, Olivia, Kinsley" 53 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/weekly_dating-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,people_string,location 2 | e16,2010/01/02,Leah,a boba shop 3 | e18,2010/01/14,Mila,a park 4 | e20,2010/02/02,Noah,a boba shop 5 | e22,2010/02/09,Nora,a park 6 | e23,2010/02/20,Daniel,a coffee Shop 7 | e24,2010/03/06,Grace,a coffee Shop 8 | e25,2010/03/09,Colton,a coffee Shop 9 | e27,2010/03/15,Carson,a park 10 | e29,2010/03/20,Jade,a boba shop 11 | e38,2010/06/13,Isabella,a park 12 | e43,2010/06/29,James,a boba shop 13 | e44,2010/07/04,Richard,a boba shop 14 | e45,2010/07/08,Jayden,a restaurant 15 | e54,2010/08/13,Elias,a park 16 | e55,2010/08/18,Aria,a boba shop 17 | e57,2010/08/23,Athena,a boba shop 18 | e58,2010/09/03,Skylar,a boba shop 19 | e64,2010/10/27,Leonardo,a coffee Shop 20 | e65,2010/10/31,Aaliyah,a coffee Shop 21 | e68,2010/11/20,Anthony,a coffee Shop 22 | e70,2010/12/05,Ava,a park 23 | e73,2010/12/12,Henry,a restaurant 24 | e75,2010/12/20,Jace,a restaurant 25 | e619,2011/02/05,Paisley,a coffee Shop 26 | e620,2011/02/15,Marzieh,a restaurant 27 | e626,2011/03/11,Peyton,a coffee Shop 28 | e630,2011/04/01,Eleanor,a restaurant 29 | e633,2011/04/15,Hannah,a park 30 | e640,2011/05/12,Silas,a boba shop 31 | e642,2011/05/15,Isla,a coffee Shop 32 | e643,2011/05/17,Gianna,a park 33 | e645,2011/06/06,Lillian,a restaurant 34 | e649,2011/06/25,Angel,a park 35 | e650,2011/07/01,Isabella,a park 36 | e657,2011/08/10,Cameron,a park 37 | e659,2011/08/13,Angel,a coffee Shop 38 | e661,2011/08/24,Isabella,a coffee Shop 39 | e664,2011/09/04,Noah,a boba shop 40 | e666,2011/09/13,Aurora,a boba shop 41 | e671,2011/10/15,Isabella,a coffee Shop 42 | e679,2011/11/16,Greyson,a restaurant 43 | e683,2011/12/05,Nathan,a park 44 | e685,2011/12/13,Everett,a boba shop 45 | e1251,2012/01/13,Austin,a park 46 | e1253,2012/01/24,Asher,a boba shop 47 | e1254,2012/01/26,Lincoln,a coffee Shop 48 | e1256,2012/02/06,Aaron,a boba shop 49 | e1257,2012/02/15,James,a park 50 | e1260,2012/02/22,Christophe,a restaurant 51 | e1264,2012/03/08,Avery,a coffee Shop 52 | e1265,2012/03/16,Leah,a boba shop 53 | e1266,2012/03/24,Piper,a park 54 | e1270,2012/04/10,Connor,a park 55 | e1273,2012/04/28,Scarlett,a restaurant 56 | e1275,2012/05/08,Elijah,a restaurant 57 | e1277,2012/05/13,Ellie,a coffee Shop 58 | e1278,2012/05/18,Dylan,a park 59 | e1280,2012/05/28,Maya,a boba shop 60 | e1284,2012/06/28,Audrey,a coffee Shop 61 | e1286,2012/07/02,David,a boba shop 62 | e1291,2012/07/21,Genesis,a restaurant 63 | e1303,2012/10/11,Everleigh,a restaurant 64 | e1305,2012/10/17,Olivia,a restaurant 65 | e1310,2012/11/30,Ethan,a restaurant 66 | e1314,2012/12/19,Hunter,a park 67 | e1888,2013/01/20,Leo,a park 68 | e1890,2013/01/27,Caleb,a coffee Shop 69 | e1894,2013/02/18,Chloe,a park 70 | e1897,2013/03/24,Savannah,a park 71 | e1899,2013/03/29,Eli,a restaurant 72 | e1905,2013/05/06,Jaxson,a restaurant 73 | e1907,2013/05/08,Liam,a restaurant 74 | e1908,2013/05/10,Sadie,a coffee Shop 75 | e1911,2013/06/03,Alon,a park 76 | e1914,2013/06/07,Bella,a park 77 | e1916,2013/06/28,Lydia,a restaurant 78 | e1918,2013/07/02,Jackson,a boba shop 79 | e1920,2013/07/13,Lydia,a park 80 | e1923,2013/07/20,Savannah,a restaurant 81 | e1924,2013/07/29,Logan,a coffee Shop 82 | e1928,2013/08/10,William,a park 83 | e1930,2013/08/26,Hunter,a restaurant 84 | e1934,2013/09/07,Christian,a coffee Shop 85 | e1938,2013/10/28,Josephine,a park 86 | e1941,2013/11/08,Jonathan,a restaurant 87 | e1942,2013/12/02,Kinsley,a coffee Shop 88 | e1944,2013/12/12,Mateo,a coffee Shop 89 | e1947,2013/12/23,Delilah,a restaurant 90 | e2518,2014/01/02,William,a restaurant 91 | e2520,2014/01/14,Mason,a restaurant 92 | e2523,2014/02/03,Leilani,a boba shop 93 | e2525,2014/02/13,Abigail,a boba shop 94 | e2528,2014/02/25,Wyatt,a boba shop 95 | e2533,2014/03/22,Mike,a boba shop 96 | e2535,2014/03/27,Ian,a coffee Shop 97 | e2544,2014/04/26,Sophie,a park 98 | e2546,2014/05/10,Natalia,a boba shop 99 | e2547,2014/05/16,Amelia,a boba shop 100 | e2554,2014/06/29,Adam,a park 101 | e2560,2014/07/13,Julian,a boba shop 102 | e2561,2014/07/21,Nova,a coffee Shop 103 | e2563,2014/07/28,Emilia,a restaurant 104 | e2565,2014/08/11,Kinsley,a boba shop 105 | e2568,2014/08/26,Oliver,a park 106 | e2570,2014/08/31,Mike,a restaurant 107 | e2576,2014/10/12,Leilani,a restaurant 108 | e2581,2014/11/04,Christian,a boba shop 109 | e2583,2014/11/14,Wyatt,a park 110 | e2584,2014/11/18,Nathan,a coffee Shop 111 | e2586,2014/12/04,Lillian,a boba shop 112 | e2588,2014/12/16,Emma,a park 113 | e3167,2015/01/07,Olivia,a boba shop 114 | e3169,2015/01/12,Roman,a restaurant 115 | e3174,2015/02/11,Delilah,a coffee Shop 116 | e3181,2015/03/12,Mateo,a park 117 | e3186,2015/04/14,Ella,a restaurant 118 | e3188,2015/05/15,Nora,a park 119 | e3189,2015/05/26,Brooklyn,a boba shop 120 | e3198,2015/07/13,Victoria,a park 121 | e3201,2015/07/31,Aubrey,a coffee Shop 122 | e3202,2015/08/02,Jaxon,a boba shop 123 | e3205,2015/08/19,Ariana,a coffee Shop 124 | e3210,2015/09/06,Silas,a park 125 | e3213,2015/09/28,Mike,a park 126 | e3217,2015/10/19,Mateo,a restaurant 127 | e3218,2015/10/26,Madelyn,a park 128 | e3221,2015/11/09,Hunter,a restaurant 129 | e3223,2015/11/24,Jonathan,a boba shop 130 | e3224,2015/12/04,Silas,a restaurant 131 | e3225,2015/12/07,Lydia,a park 132 | e3228,2015/12/12,Benjamin,a coffee Shop 133 | e3229,2015/12/15,Jaxson,a restaurant 134 | e3231,2015/12/25,Aaliyah,a coffee Shop 135 | e3232,2015/12/28,Elena,a park 136 | e3826,2016/01/12,Naomi,a boba shop 137 | e3830,2016/01/25,Claire,a boba shop 138 | e3835,2016/02/01,Nova,a restaurant 139 | e3841,2016/02/22,Naomi,a park 140 | e3843,2016/03/02,Wesley,a coffee Shop 141 | e3845,2016/03/07,Jaxson,a boba shop 142 | e3847,2016/03/21,Grayson,a boba shop 143 | e3855,2016/05/06,Liam,a boba shop 144 | e3863,2016/06/21,Santiago ,a park 145 | e3871,2016/08/01,Jordan,a restaurant 146 | e3873,2016/08/11,Wesley,a coffee Shop 147 | e3878,2016/09/02,Evelyn,a park 148 | e3883,2016/09/27,Mila,a restaurant 149 | e3884,2016/10/01,Nathan,a coffee Shop 150 | e3889,2016/10/25,Lucas,a boba shop 151 | e3892,2016/11/07,Camila,a restaurant 152 | e3897,2016/11/25,Hannah,a restaurant 153 | e3898,2016/11/30,Aaliyah,a coffee Shop 154 | e3901,2016/12/19,Christophe,a restaurant 155 | e3904,2016/12/25,Jose,a park 156 | e4467,2017/01/03,Nicholas,a boba shop 157 | e4469,2017/01/10,Marzieh,a boba shop 158 | e4470,2017/01/14,Jack,a park 159 | e4483,2017/03/30,Nevaeh,a coffee Shop 160 | e4485,2017/04/07,Owen,a park 161 | e4487,2017/05/04,Sadie,a park 162 | e4491,2017/05/27,Allison,a restaurant 163 | e4492,2017/06/01,Emery,a coffee Shop 164 | e4493,2017/06/05,Carson,a restaurant 165 | e4494,2017/06/08,Jayden,a coffee Shop 166 | e4499,2017/07/02,Daniel,a boba shop 167 | e4500,2017/07/06,Kennedy,a restaurant 168 | e4502,2017/07/10,Caroline,a boba shop 169 | e4503,2017/07/29,Emma,a park 170 | e4504,2017/08/01,Isabella,a park 171 | e4510,2017/08/21,Dylan,a boba shop 172 | e4512,2017/08/28,Isaiah,a boba shop 173 | e4515,2017/09/13,Lincoln,a coffee Shop 174 | e4519,2017/10/05,Ezra,a coffee Shop 175 | e4521,2017/10/12,Silas,a restaurant 176 | e4522,2017/10/21,Delilah,a park 177 | e4526,2017/10/29,Alexander,a coffee Shop 178 | e4534,2017/12/10,Matthew,a boba shop 179 | e5115,2018/01/18,Isla,a park 180 | e5120,2018/02/06,Jeremiah,a restaurant 181 | e5128,2018/03/10,Charles,a restaurant 182 | e5133,2018/04/02,Henry,a coffee Shop 183 | e5134,2018/04/09,Jaxon,a coffee Shop 184 | e5135,2018/04/12,Nathan,a restaurant 185 | e5137,2018/04/21,David,a park 186 | e5142,2018/05/17,Owen,a restaurant 187 | e5148,2018/06/17,Daniel,a coffee Shop 188 | e5151,2018/06/29,Elijah,a restaurant 189 | e5154,2018/07/07,James,a restaurant 190 | e5157,2018/07/24,Autumn,a restaurant 191 | e5162,2018/08/19,Aaron,a coffee Shop 192 | e5164,2018/08/21,Chris,a boba shop 193 | e5169,2018/09/04,Isaac,a park 194 | e5171,2018/10/02,Piper,a boba shop 195 | e5175,2018/10/28,Kinsley,a coffee Shop 196 | e5181,2018/11/15,Sarah,a coffee Shop 197 | e5186,2018/12/02,Joshua,a park 198 | e5189,2018/12/15,Aurora,a restaurant 199 | e5194,2018/12/23,Sofia,a coffee Shop 200 | e5742,2019/01/04,Josephine,a park 201 | e5749,2019/02/10,Cora,a coffee Shop 202 | e5752,2019/02/15,Ivy,a coffee Shop 203 | e5754,2019/02/25,Jaxson,a restaurant 204 | e5759,2019/03/18,Athena,a restaurant 205 | e5765,2019/05/02,Isla,a boba shop 206 | e5767,2019/05/07,Theodore,a park 207 | e5768,2019/05/10,Valentina,a restaurant 208 | e5771,2019/05/25,Lily,a park 209 | e5775,2019/06/20,Ethan,a coffee Shop 210 | e5776,2019/06/21,Eva,a boba shop 211 | e5780,2019/07/09,Oliver,a park 212 | e5781,2019/07/22,Elizabeth,a park 213 | e5784,2019/08/06,Elias,a restaurant 214 | e5785,2019/08/12,Aaliyah,a park 215 | e5790,2019/09/05,Aurora,a restaurant 216 | e5792,2019/09/14,Eva,a coffee Shop 217 | e5800,2019/10/04,Ivy,a boba shop 218 | e5803,2019/10/18,Elizabeth,a restaurant 219 | e5807,2019/11/08,Leonardo,a restaurant 220 | e5811,2019/11/18,Claire,a restaurant 221 | e5815,2019/12/06,Leilani,a coffee Shop 222 | e5818,2019/12/27,Oliver,a coffee Shop 223 | e6426,2020/01/27,Zoey,a boba shop 224 | e6428,2020/02/02,Claire,a coffee Shop 225 | e6433,2020/02/25,Lucy,a coffee Shop 226 | e6435,2020/03/10,Emilia,a boba shop 227 | e6436,2020/03/20,Quinn,a restaurant 228 | e6441,2020/04/11,Michael,a restaurant 229 | e6444,2020/04/17,Claire,a boba shop 230 | e6448,2020/05/02,Isabella,a coffee Shop 231 | e6449,2020/05/08,Eva,a park 232 | e6450,2020/05/13,Claire,a park 233 | e6452,2020/05/26,Austin,a boba shop 234 | e6453,2020/06/01,Ellie,a boba shop 235 | e6456,2020/07/07,Peyton,a coffee Shop 236 | e6458,2020/07/18,Everett,a boba shop 237 | e6460,2020/08/09,Eva,a restaurant 238 | e6463,2020/08/16,Lillian,a boba shop 239 | e6465,2020/08/20,Marzieh,a boba shop 240 | e6466,2020/08/23,Jordan,a boba shop 241 | e6468,2020/09/01,Silas,a coffee Shop 242 | e6473,2020/09/21,Piper,a coffee Shop 243 | e6477,2020/10/06,Aaliyah,a boba shop 244 | e6483,2020/10/27,Owen,a coffee Shop 245 | e6486,2020/11/03,Rylee,a coffee Shop 246 | e6489,2020/11/17,Nora,a coffee Shop 247 | e6493,2020/11/20,Brooklyn,a park 248 | e6495,2020/12/16,Amelia,a boba shop 249 | e7068,2021/01/10,Wyatt,a restaurant 250 | e7071,2021/01/18,Nova,a park 251 | e7072,2021/01/28,Zoe,a boba shop 252 | e7075,2021/02/08,Eliana,a park 253 | e7077,2021/02/19,Lillian,a boba shop 254 | e7079,2021/03/01,Avery,a park 255 | e7086,2021/03/29,Aaliyah,a park 256 | e7093,2021/05/15,Hannah,a coffee Shop 257 | e7094,2021/05/17,Everly,a restaurant 258 | e7095,2021/06/03,Naomi,a park 259 | e7096,2021/06/17,Isaac,a restaurant 260 | e7097,2021/06/21,Sophia,a boba shop 261 | e7098,2021/06/25,Leah,a park 262 | e7102,2021/07/18,Lily,a boba shop 263 | e7103,2021/07/29,Wyatt,a restaurant 264 | e7105,2021/08/08,Riley,a restaurant 265 | e7108,2021/08/31,Roman,a boba shop 266 | e7112,2021/09/12,Victoria,a park 267 | e7113,2021/09/17,Dominic,a boba shop 268 | e7114,2021/09/21,Skylar,a park 269 | e7117,2021/10/07,Scarlett,a coffee Shop 270 | e7119,2021/10/17,Michael,a restaurant 271 | e7120,2021/10/18,Ezekiel,a boba shop 272 | e7122,2021/10/24,Natalie,a restaurant 273 | e7124,2021/11/04,Wang-Chiew,a park 274 | e7129,2021/11/17,Adrian,a coffee Shop 275 | e7131,2021/11/25,Kinsley,a coffee Shop 276 | e7135,2021/12/13,Natalie,a boba shop 277 | e7724,2022/01/28,Anna,a park 278 | e7728,2022/02/17,Paisley,a restaurant 279 | e7730,2022/02/22,Sofia,a boba shop 280 | e7731,2022/02/27,Amelia,a boba shop 281 | e7732,2022/03/04,Jeremiah,a boba shop 282 | e7737,2022/03/29,Hudson,a coffee Shop 283 | e7739,2022/04/11,Parker,a coffee Shop 284 | e7740,2022/04/15,Grace,a coffee Shop 285 | e7742,2022/04/20,Brooklyn,a restaurant 286 | e7748,2022/05/15,Jade,a coffee Shop 287 | e7749,2022/05/20,Jonathan,a boba shop 288 | e7751,2022/06/03,Sofia,a park 289 | e7752,2022/06/09,Aaliyah,a boba shop 290 | e7755,2022/06/18,Hailey,a restaurant 291 | e7756,2022/06/24,Landon,a boba shop 292 | e7757,2022/06/27,Peyton,a restaurant 293 | e7759,2022/07/09,Alon,a restaurant 294 | e7760,2022/07/14,Quinn,a restaurant 295 | e7764,2022/08/03,Scarlett,a boba shop 296 | e7766,2022/08/06,Gabriel,a boba shop 297 | e7771,2022/09/01,Camila,a restaurant 298 | e7776,2022/10/11,Wyatt,a park 299 | e7777,2022/10/18,Cora,a boba shop 300 | e7779,2022/10/25,Piper,a restaurant 301 | e7781,2022/11/09,Kennedy,a park 302 | e7783,2022/11/17,Everleigh,a coffee Shop 303 | e7790,2022/12/15,Naomi,a coffee Shop 304 | e7792,2022/12/23,Elena,a coffee Shop 305 | -------------------------------------------------------------------------------- /data/TimelineQA/sparse-100/weekly_hobby-log.csv: -------------------------------------------------------------------------------- 1 | eid,date,hobbies,people_string 2 | e31,2010/04/03,learning a language, 3 | e35,2010/05/31,working out,"Avery, Willow" 4 | e39,2010/06/15,working out, 5 | e48,2010/07/22,meditation, 6 | e51,2010/08/01,gardening, 7 | e52,2010/08/03,gardening, 8 | e60,2010/09/17,meditation, 9 | e61,2010/09/29,gardening, 10 | e62,2010/10/15,learning a language, 11 | e69,2010/11/29,meditation, 12 | e71,2010/12/03,gardening,"Kayden, Carter" 13 | e614,2011/01/02,working out, 14 | e615,2011/01/07,meditation, 15 | e621,2011/02/20,meditation,Emily 16 | e622,2011/02/25,yoga, 17 | e624,2011/03/01,yoga,"Claire, Hazel" 18 | e634,2011/04/11,working out, 19 | e636,2011/04/17,working out,"Kinsley, Claire, Nevaeh" 20 | e637,2011/04/21,working out, 21 | e638,2011/04/25,yoga,"Avery, Willow" 22 | e639,2011/05/06,gardening, 23 | e651,2011/07/06,gardening,Willow 24 | e653,2011/07/10,gardening, 25 | e655,2011/07/29,learning a language, 26 | e668,2011/10/07,yoga, 27 | e674,2011/11/02,working out,Kayden 28 | e677,2011/11/08,meditation, 29 | e1255,2012/01/23,learning a language, 30 | e1258,2012/02/14,meditation,"Kayden, Carter, Andrew" 31 | e1272,2012/04/17,working out,"Carter, Andrew, Kayden" 32 | e1285,2012/06/27,learning a language,"Kayden, Emily, Carter" 33 | e1287,2012/07/05,meditation, 34 | e1289,2012/07/12,working out,"Carter, Andrew, Emily" 35 | e1293,2012/08/04,gardening, 36 | e1297,2012/08/25,working out, 37 | e1301,2012/09/27,learning a language, 38 | e1302,2012/10/03,gardening, 39 | e1306,2012/11/02,meditation, 40 | e1312,2012/12/07,learning a language, 41 | e1313,2012/12/11,learning a language, 42 | e1903,2013/04/26,working out, 43 | e1906,2013/04/30,gardening, 44 | e1909,2013/05/10,gardening,"Eva, Avery, Nora" 45 | e1912,2013/06/01,learning a language,Carter 46 | e1917,2013/06/28,gardening,"Jackson, Willow, Benjamin" 47 | e1921,2013/07/10,meditation, 48 | e1922,2013/07/12,yoga, 49 | e1926,2013/08/03,yoga, 50 | e1931,2013/08/22,meditation, 51 | e1936,2013/10/04,gardening, 52 | e1939,2013/10/28,yoga, 53 | e1945,2013/12/15,learning a language,"Piper, Layla" 54 | e1948,2013/12/20,gardening, 55 | e2519,2014/01/03,yoga, 56 | e2526,2014/02/15,gardening, 57 | e2530,2014/03/01,meditation, 58 | e2532,2014/03/17,meditation, 59 | e2536,2014/03/31,learning a language,"Piper, Olivia, Nevaeh" 60 | e2545,2014/04/28,working out, 61 | e2548,2014/05/19,working out, 62 | e2551,2014/06/07,gardening, 63 | e2555,2014/06/28,learning a language, 64 | e2564,2014/08/01,gardening,"Rylee, Piper" 65 | e2571,2014/08/27,yoga,Carter 66 | e2573,2014/09/12,working out, 67 | e2577,2014/10/12,learning a language, 68 | e2578,2014/10/18,meditation,"Andrew, Kayden" 69 | e3170,2015/01/21,gardening, 70 | e3180,2015/02/27,meditation, 71 | e3182,2015/03/16,gardening,"Nevaeh, Rylee, Kinsley" 72 | e3190,2015/05/23,meditation, 73 | e3191,2015/05/24,working out, 74 | e3192,2015/06/03,learning a language, 75 | e3193,2015/06/16,gardening, 76 | e3195,2015/07/01,meditation, 77 | e3199,2015/07/17,yoga,"Eva, Nevaeh, Rylee" 78 | e3200,2015/07/21,learning a language, 79 | e3203,2015/07/30,gardening, 80 | e3211,2015/09/21,yoga,"Carter, Andrew, Emily" 81 | e3214,2015/09/29,gardening,"Emily, Kayden" 82 | e3215,2015/10/01,working out, 83 | e3233,2015/12/27,meditation,"Nevaeh, Piper, Eva" 84 | e3827,2016/01/13,yoga,"Kayden, Carter, Emily" 85 | e3831,2016/01/25,working out, 86 | e3838,2016/02/14,gardening, 87 | e3849,2016/04/06,gardening,"Carter, Emily" 88 | e3850,2016/04/09,meditation,Hazel 89 | e3852,2016/04/25,meditation, 90 | e3867,2016/07/09,yoga, 91 | e3874,2016/08/07,learning a language,Andrew 92 | e3879,2016/09/14,learning a language, 93 | e3890,2016/10/21,learning a language,"Lydia, Rylee" 94 | e3894,2016/11/16,learning a language, 95 | e3902,2016/12/20,gardening, 96 | e4471,2017/01/14,meditation,Jackson 97 | e4473,2017/01/19,working out, 98 | e4475,2017/01/26,meditation, 99 | e4488,2017/05/04,yoga,"Emily, Carter, Andrew" 100 | e4489,2017/05/19,gardening, 101 | e4496,2017/06/17,yoga,Jackson 102 | e4501,2017/07/06,gardening, 103 | e4507,2017/08/16,working out,Eva 104 | e4516,2017/09/11,learning a language, 105 | e4523,2017/10/21,working out, 106 | e4529,2017/11/16,gardening,"Piper, Kinsley, Lydia" 107 | e4532,2017/11/27,gardening, 108 | e5116,2018/01/17,meditation, 109 | e5117,2018/01/20,gardening, 110 | e5124,2018/02/24,working out, 111 | e5126,2018/02/27,learning a language, 112 | e5130,2018/03/30,learning a language,Avery 113 | e5144,2018/05/22,gardening, 114 | e5145,2018/05/26,meditation, 115 | e5150,2018/06/19,yoga,Benjamin 116 | e5152,2018/06/28,meditation, 117 | e5158,2018/07/29,learning a language,"Willow, Avery" 118 | e5159,2018/08/06,gardening, 119 | e5163,2018/08/17,working out,"Kayden, Andrew" 120 | e5165,2018/08/21,yoga, 121 | e5172,2018/10/18,gardening, 122 | e5176,2018/10/23,working out,Carter 123 | e5178,2018/11/04,gardening, 124 | e5182,2018/11/16,yoga, 125 | e5190,2018/12/12,meditation, 126 | e5191,2018/12/16,working out, 127 | e5743,2019/01/04,learning a language, 128 | e5750,2019/02/07,yoga, 129 | e5755,2019/02/25,learning a language, 130 | e5770,2019/05/20,meditation,"Kayden, Emily, Carter" 131 | e5778,2019/06/26,working out, 132 | e5789,2019/08/30,working out, 133 | e5793,2019/09/15,gardening, 134 | e5795,2019/09/18,working out,"Carter, Kayden" 135 | e5796,2019/09/22,working out, 136 | e5804,2019/10/21,meditation, 137 | e5805,2019/10/29,meditation, 138 | e5808,2019/11/09,working out,"Claire, Kinsley" 139 | e5812,2019/11/17,working out, 140 | e5816,2019/12/16,working out,"Kayden, Carter, Andrew" 141 | e6430,2020/02/08,yoga, 142 | e6432,2020/02/18,learning a language,"Carter, Andrew" 143 | e6437,2020/03/21,meditation, 144 | e6439,2020/03/28,yoga, 145 | e6442,2020/04/10,working out, 146 | e6445,2020/04/18,working out, 147 | e6451,2020/05/16,gardening, 148 | e6454,2020/06/16,meditation, 149 | e6457,2020/07/07,working out,Carter 150 | e6459,2020/07/28,meditation, 151 | e6461,2020/08/10,yoga,Carter 152 | e6467,2020/08/24,yoga,"Kinsley, Hazel" 153 | e6470,2020/09/15,yoga, 154 | e6475,2020/09/28,meditation,Nora 155 | e6478,2020/10/04,learning a language, 156 | e6480,2020/10/07,yoga,Andrew 157 | e6484,2020/10/25,learning a language,"Carter, Emily" 158 | e6487,2020/11/08,yoga, 159 | e6490,2020/11/14,working out,"Andrew, Emily" 160 | e6498,2020/12/31,yoga,"Piper, Hazel, Piper" 161 | e7074,2021/01/30,working out,Jackson 162 | e7078,2021/02/24,gardening, 163 | e7081,2021/03/05,working out, 164 | e7099,2021/06/30,learning a language, 165 | e7107,2021/08/24,yoga,"Carter, Andrew, Kayden" 166 | e7110,2021/09/04,meditation, 167 | e7118,2021/10/13,learning a language,"Benjamin, Avery" 168 | e7136,2021/12/14,meditation, 169 | e7727,2022/01/31,learning a language, 170 | e7733,2022/03/09,gardening,Kinsley 171 | e7735,2022/03/24,yoga,Emily 172 | e7743,2022/04/19,learning a language, 173 | e7753,2022/06/07,yoga, 174 | e7772,2022/09/02,learning a language,Lydia 175 | e7793,2022/12/18,yoga,"Andrew, Carter, Kayden" 176 | e7794,2022/12/30,learning a language, 177 | -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `yarn start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may also see any lint errors in the console. 16 | 17 | ### `yarn test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `yarn build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `yarn eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!** 35 | 36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. 39 | 40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `yarn build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "posttext", 3 | "version": "0.1.0", 4 | "private": true, 5 | "proxy": "http://127.0.0.1:5000", 6 | "dependencies": { 7 | "@testing-library/jest-dom": "^5.14.1", 8 | "@testing-library/react": "^13.0.0", 9 | "@testing-library/user-event": "^13.2.1", 10 | "primeflex": "^3.2.1", 11 | "primeicons": "^6.0.1", 12 | "primereact": "^8.7.3", 13 | "react": "^18.2.0", 14 | "react-dom": "^18.2.0", 15 | "react-scripts": "^5.0.1", 16 | "react-syntax-highlighter": "^15.5.0", 17 | "web-vitals": "^2.1.0" 18 | }, 19 | "scripts": { 20 | "start": "react-scripts start", 21 | "build": "react-scripts build", 22 | "test": "react-scripts test", 23 | "eject": "react-scripts eject" 24 | }, 25 | "eslintConfig": { 26 | "extends": [ 27 | "react-app", 28 | "react-app/jest" 29 | ] 30 | }, 31 | "browserslist": { 32 | "production": [ 33 | ">0.2%", 34 | "not dead", 35 | "not op_mini all" 36 | ], 37 | "development": [ 38 | "last 1 chrome version", 39 | "last 1 firefox version", 40 | "last 1 safari version" 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | PostText Demo 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [], 5 | "start_url": ".", 6 | "display": "standalone", 7 | "theme_color": "#000000", 8 | "background_color": "#ffffff" 9 | } 10 | -------------------------------------------------------------------------------- /frontend/src/App.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React, { useEffect, useState } from 'react'; 18 | import { Terminal } from 'primereact/terminal'; 19 | import { TerminalService } from 'primereact/terminalservice'; 20 | import { Panel } from 'primereact/panel'; 21 | import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; 22 | import { coy } from 'react-syntax-highlighter/dist/esm/styles/prism'; 23 | import { ProgressBar } from 'primereact/progressbar'; 24 | 25 | 26 | import './index.css'; 27 | 28 | export default function App() { 29 | 30 | const [question, setQuestion] = useState(""); 31 | 32 | const [sqlBefore, setSQLBefore] = useState(""); 33 | 34 | const [sqlAfter, setSQLAfter] = useState(""); 35 | 36 | const [sqlResult, setSQLResult] = useState(""); 37 | 38 | const [prompt, setPrompt] = useState(""); 39 | 40 | const [running, setRunning] = useState(false); 41 | 42 | 43 | const commandHandler = (text) => { 44 | let response; 45 | let argsIndex = text.indexOf(' '); 46 | let command = argsIndex !== -1 ? text.substring(0, argsIndex) : text; 47 | 48 | switch (command) { 49 | // case 'date': 50 | // response = 'Today is ' + new Date().toDateString(); 51 | // break; 52 | 53 | // case 'greet': 54 | // response = 'Hola ' + text.substring(argsIndex + 1) + '!'; 55 | // break; 56 | 57 | // case 'random': 58 | // response = Math.floor(Math.random() * 100); 59 | // break; 60 | 61 | case 'clear': 62 | TerminalService.emit('clear'); 63 | break; 64 | 65 | default: 66 | TerminalService.emit('response', 'Running...'); 67 | setRunning(true); 68 | fetch("/query?" + new URLSearchParams({query: text})).then((response) => response.json()) 69 | .then((data) => { 70 | setQuestion(text); 71 | setPrompt(data.prompt); 72 | setSQLBefore(data.sql_before); 73 | setSQLAfter(data.sql_after); 74 | setSQLResult(data.result); 75 | response = 'Prompt: \n\n' + data.prompt + 76 | '\n\nSQL (Before): \n\n' + data.sql_before + 77 | '\n\nSQL (After): \n\n' + data.sql_after + 78 | '\n\nQuery result: \n\n' + data.result; 79 | TerminalService.emit('response', 'Done!'); 80 | setRunning(false); 81 | }); 82 | break; 83 | } 84 | 85 | }; 86 | 87 | useEffect(() => { 88 | TerminalService.on('command', commandHandler); 89 | 90 | return () => { 91 | TerminalService.off('command', commandHandler); 92 | }; 93 | }, []); 94 | 95 | return ( 96 |
97 |

PostText

98 |

99 | Enter a question or "clear" to clear all commands. 100 |

101 | 102 | 103 | 104 | 105 | 106 | {/*

{prompt}

*/} 107 | 108 | {prompt} 109 | 110 |
111 | 112 | 113 | {/*

{}

*/} 114 | 115 | {sqlBefore} 116 | 117 |
118 | 119 | 120 | {/*

{sqlAfter}

*/} 121 | 122 | {sqlAfter} 123 | 124 |
125 | 126 | 127 | {/*

{sqlResult}

*/} 128 | 129 | {sqlResult} 130 | 131 |
132 | 133 | 134 |
135 | ); 136 | } 137 | 138 | -------------------------------------------------------------------------------- /frontend/src/index.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | body { 6 | font-family: var(--font-family); 7 | font-weight: normal; 8 | background: var(--surface-card); 9 | color: var(--text-color); 10 | padding: 1rem; 11 | -webkit-font-smoothing: antialiased; 12 | -moz-osx-font-smoothing: grayscale; 13 | } 14 | 15 | .posttext-demo p { 16 | white-space: pre-wrap; 17 | } -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import React from 'react'; 18 | import ReactDOM from 'react-dom/client'; 19 | import 'primereact/resources/themes/lara-light-indigo/theme.css'; // theme 20 | import 'primereact/resources/primereact.css'; // core css 21 | import 'primeicons/primeicons.css'; // icons 22 | import 'primeflex/primeflex.css'; // css utility 23 | import './index.css'; 24 | import App from './App'; 25 | 26 | const root = ReactDOM.createRoot(document.getElementById('root')); 27 | root.render( 28 | 29 | 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | plotly 2 | matplotlib 3 | scikit-learn 4 | openai 5 | flask 6 | langchain 7 | faiss-cpu 8 | mlflow 9 | -------------------------------------------------------------------------------- /server.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import sys 18 | import os 19 | from flask import Flask, redirect, url_for, request, render_template, send_from_directory 20 | from posttext import PostText 21 | from configparser import ConfigParser 22 | 23 | config_object = None 24 | engine = None 25 | 26 | app = Flask(__name__) 27 | 28 | def create_app(): 29 | global config_object 30 | global engine 31 | 32 | config_object = ConfigParser(comment_prefixes=None) 33 | config_object.read(app.config.get('data_dir')+"/config.ini") 34 | engine = PostText(config_object, app.config.get('data_dir')) 35 | 36 | # # for profiling 37 | # from werkzeug.middleware.profiler import ProfilerMiddleware 38 | # app.wsgi_app = ProfilerMiddleware(app.wsgi_app) 39 | 40 | @app.route('/test', methods=['GET']) 41 | def test(): 42 | """ 43 | TODO: make calls to the appropriate python function 44 | TODO: we may want to change these API's to POST apis 45 | """ 46 | # query = request.args.get('event') 47 | for key in request.args: 48 | print(key, request.args[key]) 49 | return {'message': 'okay'} 50 | 51 | 52 | @app.route('/query', methods=['GET']) 53 | def query(): 54 | """Query the posttext engine. 55 | """ 56 | q = request.args.get('query') 57 | prompt, sql_before, sql_after, result = engine.query(q) 58 | return {'prompt': prompt, 59 | 'sql_before': sql_before, 60 | 'sql_after': sql_after, 61 | 'result': result} 62 | 63 | 64 | if __name__ == '__main__': 65 | app.config['data_dir'] = sys.argv[1] 66 | create_app() 67 | app.run(debug=True) 68 | -------------------------------------------------------------------------------- /src/posttext.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import os 18 | import sys 19 | 20 | #from .retrieval_qa import RetrievalBasedQA 21 | #from .views_qa import ViewBasedQA 22 | from src.views_qa import * 23 | from src.retrieval_qa import * 24 | from typing import Dict 25 | from configparser import ConfigParser 26 | 27 | 28 | class PostText: 29 | 30 | def __init__(self, 31 | config: Dict, 32 | directory: str): 33 | """Original code parameters. 34 | """ 35 | self.retrieval_qa = RetrievalBasedQA(config, directory) 36 | self.view_qa = ViewBasedQA(config, directory) 37 | 38 | 39 | def query(self, question: str): 40 | """Process the query using all available QA components. 41 | """ 42 | print("Computing with views:") 43 | formattedprompt = "" 44 | sqlquery_before = "" 45 | sqlquery = "" 46 | view_res = "" 47 | eng_answer = "" 48 | provenance_ids = "" 49 | retrieval_res = "" 50 | 51 | view_error = False 52 | rag_error = False 53 | 54 | try: 55 | formattedprompt, sqlquery_before, sqlquery, view_res, eng_answer, provenance_ids = self.view_qa(question) 56 | print("View-based answer:") 57 | print(view_res) 58 | print(eng_answer) 59 | print("Sources:", end="") 60 | print(provenance_ids) 61 | except Exception as error: 62 | view_res = error 63 | eng_answer = error 64 | print('Unsuccessful with view-based computation, please use only RAG answer. [', error, ']') 65 | view_error = True 66 | 67 | 68 | try: 69 | print("RAG answer:") 70 | retrieval_res = self.retrieval_qa(question) 71 | print(retrieval_res) 72 | except Exception as error: 73 | print('Unsuccessful with RAG-based computation: [', error, ']') 74 | retrieval_res = "" 75 | rag_error = True 76 | 77 | 78 | if view_error and rag_error: 79 | raise Exception("Error in computing answer") 80 | else: 81 | return formattedprompt, sqlquery_before, sqlquery, view_res, eng_answer, provenance_ids, retrieval_res 82 | 83 | def main(argv): 84 | #Read config.ini file 85 | if len(argv[0]) <= 0: 86 | print("posttext.py ") 87 | return 88 | 89 | config = ConfigParser(comment_prefixes=None) 90 | directory = argv[0] 91 | config.read(os.path.join(directory, "config.ini")) 92 | 93 | # create a posttext instance 94 | posttext = PostText(config, directory) 95 | 96 | # process a single query 97 | while True: 98 | print() 99 | print() 100 | print("PostText v0.0 ====>") 101 | question = input("Enter your question:\n") 102 | if len(question.strip())==0: 103 | continue 104 | try: 105 | posttext.query(question) 106 | except Exception as error: 107 | print("No success in computing an answer: [", error, "]") 108 | print("Please try again. Ctrl-C to end.") 109 | 110 | 111 | if __name__ == "__main__": 112 | main(sys.argv[1:]) 113 | -------------------------------------------------------------------------------- /src/retrieval_qa.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import pickle 18 | import os 19 | import langchain 20 | 21 | from langchain import OpenAI 22 | from langchain.chains import RetrievalQAWithSourcesChain 23 | from langchain.cache import InMemoryCache 24 | from langchain.chat_models import ChatOpenAI 25 | import datetime 26 | 27 | class RetrievalBasedQA: 28 | 29 | def __init__(self, config, directory): 30 | self.config = config 31 | self.source_idx_path = os.path.join(directory, config["input"]["source_idx"]) 32 | self.source_vectorstore = self.load_source_vectorstore(self.source_idx_path) 33 | self.rag_qa_model = config["RAG"]["qa_model"] 34 | self.rag_temperature = config["RAG"]["temperature"] 35 | self.rag_topk = config["RAG"]["topk"] 36 | self.llm = ChatOpenAI(model_name=self.config["RAG"]["qa_model"], temperature=self.config["RAG"]["temperature"]) 37 | 38 | self.chain = RetrievalQAWithSourcesChain.from_chain_type(self.llm, 39 | chain_type="stuff", 40 | reduce_k_below_max_tokens=True, 41 | retriever=self.source_vectorstore.as_retriever(search_kwargs={"k": int(self.rag_topk)})) 42 | 43 | 44 | def load_source_vectorstore(self, path: str): 45 | """Load the episode vectorstore from pickle files. 46 | """ 47 | vectorstore = "" 48 | with open(path, "rb") as f: 49 | vectorstore = pickle.load(f) 50 | return vectorstore 51 | 52 | def query(self, question: str): 53 | """Use the RetrievalQAWithSourcesChain from langchain for QA. 54 | """ 55 | e1 = datetime.datetime.now() 56 | res = self.chain({"question": question}) 57 | e2 = datetime.datetime.now() 58 | e3 = e2 - e1 59 | print(f"Elapsed time: {e3}") 60 | return res 61 | 62 | def __call__(self, question: str): 63 | return self.query(question) 64 | -------------------------------------------------------------------------------- /src/views_util.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import numpy as np 18 | import pandas as pd 19 | from json import dumps 20 | import re 21 | 22 | import sqlite3 23 | from sqlite3 import Error 24 | import sqlparse 25 | from sqlparse.sql import IdentifierList, Identifier, Function, Where, Parenthesis, TokenList, Comparison, Operation 26 | from sqlparse import tokens as T 27 | from openai.embeddings_utils import get_embedding, cosine_similarity 28 | import dbm 29 | import pickle 30 | 31 | # viewspath = "" 32 | # idxpath = "" 33 | # queryfilepath = "" 34 | # views_catalog_dict = {} 35 | 36 | def get_embedding_with_cache(text,engine): 37 | with dbm.open('cache', 'c') as db: 38 | if text in db: 39 | return pickle.loads(db[text]) 40 | else: 41 | res = get_embedding(text,engine=engine) 42 | db[text] = pickle.dumps(res) 43 | return res 44 | 45 | # define user defined function fuzzy LIKE based on comparing embeddings 46 | def _customLIKE(arg1,arg2): 47 | # code for arg1 LIKE arg2 48 | #arg1 is the source string, arg2 is the target string 49 | 50 | embedding_model = "text-embedding-ada-002" 51 | #embedding_model = "text-similarity-davinci-001" 52 | a1 = arg1.strip() 53 | a2 = arg2.strip() 54 | if a1 == a2: 55 | return 1.0 56 | elif a1 == "" or a2 == "": 57 | return 0.0 58 | else: 59 | v1 = get_embedding_with_cache(a1,engine=embedding_model) 60 | v2 = get_embedding_with_cache(a2,engine=embedding_model) 61 | maxres = cosine_similarity(v1,v2) 62 | 63 | # long target strings tend to "dilute" the scores 64 | if len(arg2) > 8*len(arg1): 65 | threshold = 0.84 66 | elif len(arg2) > 4*len(arg1): 67 | threshold = 0.86 68 | else: 69 | threshold = 0.88 70 | 71 | if maxres > threshold: 72 | return 1 #true 73 | else: 74 | return 0 #false 75 | 76 | 77 | def raise_missing_field_error(error_str): 78 | format_dict = {"field_name":error_str} 79 | output_str = "Missing {field_name} field." 80 | print(output_str.format(**format_dict)) 81 | sys.exit(2) 82 | 83 | # read metadata about views and create index 84 | def read_views_catalog(viewspath): 85 | 86 | views_dict = {} 87 | 88 | i = 0 89 | with open(viewspath, "r") as f: 90 | while True: 91 | table_desc = {} 92 | nm = "" 93 | description = "" 94 | schema = "" 95 | additional_context = "" 96 | foreign_key = "" 97 | attr_desc = [] 98 | line = f.readline() 99 | if not line: 100 | break 101 | # skip lines with "##" at the beginning 102 | while line.startswith("##"): 103 | line = f.readline() 104 | if not line: 105 | break 106 | 107 | if line.startswith("name:"): 108 | i = line.index("name:") 109 | nm = line[i+len("name:"):].strip() 110 | 111 | line = f.readline() 112 | if not line: 113 | raise_missing_field_error("description") 114 | if "description:" in line: 115 | i = line.index("description:") 116 | description = line[i+len("description:"):].strip() 117 | table_desc["description"] = description 118 | 119 | line = f.readline() 120 | if not line: 121 | raise_missing_field_error("schema") 122 | if "schema:" in line: 123 | i = line.index("schema:") 124 | schema = line[i+len("schema:"):].strip() 125 | table_desc["schema"] = schema 126 | 127 | line = f.readline() 128 | if not line: 129 | raise_missing_field_error("example queries:") 130 | if "example queries:" in line: 131 | i = line.index("example queries:") 132 | schema = line[i+len("example queries:"):].strip() 133 | table_desc["example queries"] = schema 134 | 135 | line = f.readline() 136 | if not line: 137 | raise_missing_field_error("additional_context") 138 | if "additional_context" in line: 139 | i = line.index("additional_context:") 140 | additional_context = line[i+len("additional_context:"):].strip() 141 | if len(additional_context) == 0: 142 | table_desc["additional_context"] = "" 143 | else: 144 | table_desc["additional_context"] = additional_context 145 | 146 | line = f.readline() 147 | if not line: 148 | raise_missing_field_error("foreign key") 149 | if "foreign key:" in line: 150 | i = line.index("foreign key:") 151 | foreign_key = line[i+len("foreign key:"):].strip() 152 | table_desc["foreign_key"] = foreign_key 153 | 154 | attribute_desc = [] 155 | schema = {} 156 | while True: 157 | line = f.readline() 158 | if len(line.strip()) == 0: 159 | break 160 | attribute_desc.append(line.strip()) 161 | # store schema of table 162 | j = line.find(":") 163 | attrname = line[0:j].strip() 164 | k = line.find("//") 165 | attrtype = line[j+1:k].strip() 166 | schema[attrname] = attrtype 167 | 168 | table_desc["attrs"] = attribute_desc 169 | table_desc["schema"] = schema 170 | 171 | if len(nm)>0: 172 | views_dict[nm] = table_desc 173 | 174 | f.close() 175 | return views_dict 176 | 177 | 178 | # assumes sql query is of the form 179 | #SELECT column1, column2,....,columnN 180 | #FROM tableName 181 | #WHERE [conditions] 182 | #GROUP BY column1 183 | #HAVING [conditons] 184 | #ORDER BY column2 185 | #LIMIT 186 | 187 | def escapeSingleQuote(str): 188 | newstr = '' 189 | for i in range(0,len(str)): 190 | if str[i] == "'": 191 | newstr = newstr + "''" 192 | else: 193 | newstr = newstr + str[i] 194 | return newstr 195 | 196 | def strip_percent(str): 197 | # remove beginning and end % from string. '%%video games%%' --> 'video games' 198 | i = 0 199 | print(str) 200 | while (str[i]=='%'): 201 | i = i + 1 202 | j = len(str) - 1 203 | while (str[j]=='%'): 204 | j = j - 1 205 | return str[i:j+1] 206 | 207 | 208 | def prep_SQL(sql, question, schema): 209 | sql = sqlparse.format(sql, strip_comments=True).strip() 210 | p = sqlparse.parse(sql)[0] 211 | 212 | newsql = "" 213 | question = escapeSingleQuote(question) 214 | for t0 in p.tokens: 215 | if t0.value.upper() == 'HAVING': 216 | newsql = newsql + "HAVING" 217 | elif isinstance(t0, Where): 218 | # deep dive into Where clause 219 | tokeniter = iter(t0.tokens) 220 | while True: 221 | try: 222 | t1 = next(tokeniter) 223 | except StopIteration: 224 | break 225 | if isinstance(t1,Comparison): 226 | t1list = t1.tokens 227 | k = 0 228 | while not (t1list[k].ttype==T.Comparison): 229 | k = k + 1 230 | comp_op = t1list[k] 231 | attrname = t1.left.value 232 | value = t1.right.value 233 | if (isinstance(t1.right,Parenthesis)): 234 | newsql = newsql + attrname + " " + comp_op.value + " " + prep_SQL(value, question, schema) 235 | elif comp_op.value in ["=", "<", ">", "<=", ">=", "!=", "IN"]: 236 | if attrname in schema.keys() and schema[attrname] == "TEXT" and comp_op.value == "=" and (t1.right.ttype == T.Literal.String.Single): 237 | # of the form attrname = 'strvalue' 238 | #TODO: avoid hardcoding 0.85 239 | value = escapeSingleQuote(value[1:len(value)-1]) 240 | #newsql = newsql + "(" + attrname + " LIKE '%" + value + "%' OR CLOSE('"+question + " " + attrname + ":" + value + "'," + attrname + ")>0.88)" 241 | newsql = newsql + "(" + attrname + " LIKE '%" + value + "%' OR CLOSE('" + strip_percent(value) + "', " + attrname + "))" 242 | else: 243 | newsql = newsql + t1.value 244 | elif comp_op.value == 'LIKE': 245 | if (t1.right.ttype == T.Literal.String.Single): 246 | value = escapeSingleQuote(value[1:len(value)-1]) 247 | compstr = t1.left.value + " LIKE '" + value +"'" 248 | #newsql = newsql + "(" + compstr + " OR CLOSE('"+ question + " " + attrname + ":" + value + "'," + attrname+")>0.88)" 249 | newsql = newsql + "(" + attrname + " LIKE '%" + value + "%' OR CLOSE('" + strip_percent(value) + "', " + attrname + "))" 250 | else: 251 | newsql = newsql + t1.value 252 | elif isinstance(t1,Parenthesis): 253 | # check if next element is a DML 254 | # recurse on this sub condition or subquery 255 | newsql = newsql + prep_SQL(t1.value, question, schema) 256 | elif (t1.ttype==None): #likely a substatement, recurse 257 | newsql = newsql + prep_SQL(t1.value, question, schema) 258 | elif not(t1.value.strip() == "#"): 259 | newsql = newsql + t1.value 260 | elif (t0.value[0] == "(" and (isinstance(t0,Parenthesis) or t0.ttype==None)): 261 | #a substatement, recurse without "(...)" 262 | sub = t0.value 263 | remainingstr = "" 264 | if sub[len(sub)-1] == ')': 265 | sub = sub[1:len(sub)-1] 266 | else: 267 | # find last ')' 268 | ridx = sub.rfind(')') 269 | remainingstr = sub[ridx+1:] 270 | sub = sub[1:ridx] 271 | newsql = newsql + "(" + prep_SQL(sub, question, schema) + ")" + remainingstr 272 | elif not (t0.value.strip() == "#"): 273 | # keep existing tokens 274 | newsql = newsql + t0.value 275 | 276 | return newsql 277 | 278 | 279 | 280 | # return description of views as a list 281 | def get_desc(views_catalog_dict, short): 282 | desc = [] 283 | for key in views_catalog_dict: 284 | table_desc = views_catalog_dict[key] 285 | if short: 286 | table_desc_short = {} 287 | table_desc_short['description'] = table_desc['description'] 288 | table_desc_short['example queries'] = table_desc['example queries'] 289 | table_desc_short['additional_context'] = table_desc['additional_context'] 290 | desc.append(dumps(table_desc_short)) 291 | else: 292 | desc.append(dumps(table_desc)) 293 | return desc 294 | 295 | 296 | def get_table_names(views_catalog_dict): 297 | names = [] 298 | for key in views_catalog_dict: 299 | names.append(key) 300 | return names 301 | -------------------------------------------------------------------------------- /util/create_metadata_idx.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import os 18 | import sys 19 | [sys.path.append(i) for i in ['.', '..']] 20 | import csv 21 | import pandas as pd 22 | 23 | import openai 24 | from openai.embeddings_utils import get_embedding, cosine_similarity 25 | from src.views_util import * 26 | from configparser import ConfigParser 27 | 28 | def main(argv): 29 | #execute this command in the directory where config.ini is located 30 | print(argv[0]) 31 | 32 | 33 | # read config.ini 34 | config_obj = ConfigParser(comment_prefixes=None) 35 | config_obj.read(argv[1]) 36 | 37 | views_catalog_dict = read_views_catalog(argv[0]) 38 | views_desc_store = get_desc(views_catalog_dict, short=True) 39 | tablename_store = get_table_names(views_catalog_dict) 40 | 41 | embedding_model = config_obj['embedding_model']['model'] 42 | # this the encoding for text-embedding-ada-002 43 | embedding_encoding = config_obj["embedding_model"]["encoding"] 44 | max_tokens = config_obj["embedding_model"]["max_tokens"] # the maximum for text-embedding-ada-002 is 8191 45 | 46 | views_desc_store = get_desc(views_catalog_dict, short=True) 47 | df = pd.DataFrame() 48 | 49 | df['tablename'] = tablename_store 50 | 51 | # read from views metadata file to generate embeddings 52 | vectors = map(lambda x: get_embedding(x, engine=embedding_model), views_desc_store) 53 | vectorslist = list(vectors) 54 | df['embedding'] = vectorslist 55 | # store embeddings 56 | df.to_csv(argv[2], index=False) 57 | print("stored embeddings to "+argv[2]) 58 | 59 | 60 | if __name__ == "__main__": 61 | main(sys.argv[1:]) 62 | -------------------------------------------------------------------------------- /util/date_cleaner.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import pandas as pd 18 | import sys, getopt 19 | from datetime import datetime 20 | import os 21 | 22 | def main(argv): 23 | filename = argv[0] 24 | df = pd.read_csv(filename) 25 | targetcol = argv[1] 26 | newcol = argv[2] 27 | outputfilename = argv[3] 28 | datelist = [] 29 | for t in df[targetcol]: 30 | d_obj = datetime.strptime(t, '%m/%d/%Y') 31 | datelist.append(d_obj.strftime('%Y/%m/%d')) 32 | df.drop(targetcol, axis=1) 33 | df[newcol] = datelist 34 | 35 | df.to_csv(outputfilename, index=False) 36 | 37 | if __name__ == "__main__": 38 | main(sys.argv[1:]) 39 | -------------------------------------------------------------------------------- /util/dd_cleaner.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import pandas as pd 18 | import sys, getopt 19 | from datetime import datetime 20 | import os 21 | 22 | def main(argv): 23 | filename = argv[0] 24 | try: 25 | opts, args = getopt.getopt(argv[1:],"hr:t:o:",["positions=", "timecol=", "output="]) 26 | except getopt.GetoptError: 27 | print('dd_cleaner -r -t -o ') 28 | sys.exit(2) 29 | 30 | column_pos_list = [] 31 | timecol = "" 32 | df = pd.read_csv(filename) 33 | outputfilename = "" 34 | for opt, arg in opts: 35 | if opt == '-h': 36 | print() 37 | print('dd_cleaner -r -t -o ') 38 | print() 39 | print('-r list of positional columns to remove comman separated. e.g., "0,2"') 40 | print('-t formats the column into and e.g, 2019-04-19T04:37:00 becomes 2019/04/13 and 04:37:00') 41 | print('-o outputfilename') 42 | sys.exit() 43 | elif opt == '-r': 44 | tem = arg.split(",") 45 | column_pos_list = list(map(lambda x: int(x), tem)) 46 | df=df.drop(df.columns[column_pos_list], axis=1) 47 | elif opt == '-t': 48 | temlist = arg.split(",") 49 | targetcol = temlist[0] 50 | newcol1 = temlist[1] 51 | newcol2 = temlist[2] 52 | datelist = [] 53 | timelist = [] 54 | for t in df[targetcol]: 55 | #split after YYYY-MM-DD 56 | l0 = t[0:10] 57 | l1 = t[11:] 58 | d_obj = datetime.strptime(l0, '%Y-%m-%d') 59 | datelist.append(d_obj.strftime('%Y/%m/%d')) 60 | timelist.append(l1.strip()) 61 | df.drop(targetcol, axis=1) 62 | df[newcol1] = datelist 63 | df[newcol2] = timelist 64 | elif opt == '-o': 65 | outputfilename = arg 66 | 67 | df.to_csv(outputfilename, index=False) 68 | 69 | if __name__ == "__main__": 70 | main(sys.argv[1:]) 71 | -------------------------------------------------------------------------------- /util/digital_data2vectorstore.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import os 18 | import sys 19 | import csv 20 | import pandas as pd 21 | 22 | from langchain.vectorstores.faiss import FAISS 23 | from langchain.embeddings import OpenAIEmbeddings 24 | import pickle 25 | from langchain.docstore.document import Document 26 | from datetime import datetime 27 | 28 | def verbalize(episodes): 29 | all_text = [] 30 | all_meta = [] 31 | id2epi = {} 32 | for i, dt, desc, details, tt in zip(episodes['id'], episodes['date'], episodes['desc'], episodes['details'], episodes['time']): 33 | l0 = dt[0:10] 34 | l1 = dt[11:] 35 | text = 'On ' + dt + ' ' + tt 36 | print(text) 37 | metadata = {'source': i} 38 | all_text.append(text) 39 | all_meta.append(metadata) 40 | id2epi[i] = text 41 | 42 | return all_text, all_meta, id2epi 43 | 44 | def main(argv): 45 | 46 | episodes = pd.read_csv(argv[0]) 47 | textdata, metadata, id2epi = verbalize(episodes) 48 | embeddings = OpenAIEmbeddings() 49 | 50 | docsearch = FAISS.from_texts(textdata, embeddings, metadatas=metadata) 51 | 52 | # Save vectorstore 53 | with open(argv[1], "wb") as f: 54 | pickle.dump(docsearch, f) 55 | 56 | 57 | 58 | if __name__ == "__main__": 59 | main(sys.argv[1:]) 60 | -------------------------------------------------------------------------------- /util/jsontimeline2csv.py: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import json 18 | import sys 19 | import pandas as pd 20 | from collections import OrderedDict 21 | 22 | def main(argv): 23 | filepath = argv[0] 24 | print("Loading "+filepath) 25 | f = open(filepath) 26 | data = json.load(f) 27 | print("Completed") 28 | 29 | #keys = data.keys() 30 | keys = list(data.keys()) 31 | keys.sort() 32 | 33 | print("Converting to csv .", end="") 34 | dict = { 'id':[], 'date':[], 'desc':[], 'details':[]} 35 | df = pd.DataFrame(dict) 36 | for k in keys: 37 | for episode in data[k]: 38 | dftem = pd.DataFrame([[k, data[k][episode]['text_template_based']]], columns=['date','desc']) 39 | df = pd.concat([df, dftem]) 40 | print(".", end="") 41 | 42 | # details column is for Aria data with more detailed description 43 | df['details'] = df['desc'] 44 | l = [] 45 | for i in range(0,len(df)): 46 | l.append(i) 47 | df['id'] = l 48 | 49 | print("") 50 | df.to_csv(argv[1], index=False) 51 | print("Done") 52 | 53 | if __name__ == "__main__": 54 | main(sys.argv[1:]) 55 | --------------------------------------------------------------------------------