├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── access ├── evaluation │ ├── general.py │ └── utils.py ├── fairseq │ ├── base.py │ └── main.py ├── feature_extraction.py ├── preprocess.py ├── preprocessors.py ├── resources │ ├── datasets.py │ ├── paths.py │ ├── prepare.py │ └── utils.py ├── simplifiers.py ├── text.py └── utils │ ├── helpers.py │ └── training.py ├── requirements.txt ├── resources ├── .gitignore └── various │ └── sentencepiece_model │ ├── sentencepiece_model_10000.model │ └── sentencepiece_model_10000.vocab ├── scripts ├── evaluate.py ├── generate.py └── train.py ├── setup.cfg ├── setup.py └── system_output ├── README.md ├── easse_report.html ├── other_formats ├── test.pred.raw ├── test.pred.tok ├── valid.pred.raw └── valid.pred.tok ├── test.complex ├── test.pred ├── valid.complex └── valid.pred /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.swp 3 | .venv 4 | *.egg-info 5 | .pytest_cache 6 | .nfs* 7 | experiments 8 | -------------------------------------------------------------------------------- /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 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at . All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to access 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 `master`. 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 access, you agree that your contributions will be licensed 31 | under the LICENSE file in the root directory of this source tree. 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution-NonCommercial 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-NonCommercial 4.0 International Public 58 | License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-NonCommercial 4.0 International Public License ("Public 63 | License"). To the extent this Public License may be interpreted as a 64 | contract, You are granted the Licensed Rights in consideration of Your 65 | acceptance of these terms and conditions, and the Licensor grants You 66 | such rights in consideration of benefits the Licensor receives from 67 | making the Licensed Material available under these terms and 68 | conditions. 69 | 70 | Section 1 -- Definitions. 71 | 72 | a. Adapted Material means material subject to Copyright and Similar 73 | Rights that is derived from or based upon the Licensed Material 74 | and in which the Licensed Material is translated, altered, 75 | arranged, transformed, or otherwise modified in a manner requiring 76 | permission under the Copyright and Similar Rights held by the 77 | Licensor. For purposes of this Public License, where the Licensed 78 | Material is a musical work, performance, or sound recording, 79 | Adapted Material is always produced where the Licensed Material is 80 | synched in timed relation with a moving image. 81 | 82 | b. Adapter's License means the license You apply to Your Copyright 83 | and Similar Rights in Your contributions to Adapted Material in 84 | accordance with the terms and conditions of this Public License. 85 | 86 | c. Copyright and Similar Rights means copyright and/or similar rights 87 | closely related to copyright including, without limitation, 88 | performance, broadcast, sound recording, and Sui Generis Database 89 | Rights, without regard to how the rights are labeled or 90 | categorized. For purposes of this Public License, the rights 91 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 92 | Rights. 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. NonCommercial means not primarily intended for or directed towards 116 | commercial advantage or monetary compensation. For purposes of 117 | this Public License, the exchange of the Licensed Material for 118 | other material subject to Copyright and Similar Rights by digital 119 | file-sharing or similar means is NonCommercial provided there is 120 | no payment of monetary compensation in connection with the 121 | exchange. 122 | 123 | j. Share means to provide material to the public by any means or 124 | process that requires permission under the Licensed Rights, such 125 | as reproduction, public display, public performance, distribution, 126 | dissemination, communication, or importation, and to make material 127 | available to the public including in ways that members of the 128 | public may access the material from a place and at a time 129 | individually chosen by them. 130 | 131 | k. Sui Generis Database Rights means rights other than copyright 132 | resulting from Directive 96/9/EC of the European Parliament and of 133 | the Council of 11 March 1996 on the legal protection of databases, 134 | as amended and/or succeeded, as well as other essentially 135 | equivalent rights anywhere in the world. 136 | 137 | l. You means the individual or entity exercising the Licensed Rights 138 | under this Public License. Your has a corresponding meaning. 139 | 140 | Section 2 -- Scope. 141 | 142 | a. License grant. 143 | 144 | 1. Subject to the terms and conditions of this Public License, 145 | the Licensor hereby grants You a worldwide, royalty-free, 146 | non-sublicensable, non-exclusive, irrevocable license to 147 | exercise the Licensed Rights in the Licensed Material to: 148 | 149 | a. reproduce and Share the Licensed Material, in whole or 150 | in part, for NonCommercial purposes only; and 151 | 152 | b. produce, reproduce, and Share Adapted Material for 153 | NonCommercial purposes only. 154 | 155 | 2. Exceptions and Limitations. For the avoidance of doubt, where 156 | Exceptions and Limitations apply to Your use, this Public 157 | License does not apply, and You do not need to comply with 158 | its terms and conditions. 159 | 160 | 3. Term. The term of this Public License is specified in Section 161 | 6(a). 162 | 163 | 4. Media and formats; technical modifications allowed. The 164 | Licensor authorizes You to exercise the Licensed Rights in 165 | all media and formats whether now known or hereafter created, 166 | and to make technical modifications necessary to do so. The 167 | Licensor waives and/or agrees not to assert any right or 168 | authority to forbid You from making technical modifications 169 | necessary to exercise the Licensed Rights, including 170 | technical modifications necessary to circumvent Effective 171 | Technological Measures. For purposes of this Public License, 172 | simply making modifications authorized by this Section 2(a) 173 | (4) never produces Adapted Material. 174 | 175 | 5. Downstream recipients. 176 | 177 | a. Offer from the Licensor -- Licensed Material. Every 178 | recipient of the Licensed Material automatically 179 | receives an offer from the Licensor to exercise the 180 | Licensed Rights under the terms and conditions of this 181 | Public License. 182 | 183 | b. No downstream restrictions. You may not offer or impose 184 | any additional or different terms or conditions on, or 185 | apply any Effective Technological Measures to, the 186 | Licensed Material if doing so restricts exercise of the 187 | Licensed Rights by any recipient of the Licensed 188 | Material. 189 | 190 | 6. No endorsement. Nothing in this Public License constitutes or 191 | may be construed as permission to assert or imply that You 192 | are, or that Your use of the Licensed Material is, connected 193 | with, or sponsored, endorsed, or granted official status by, 194 | the Licensor or others designated to receive attribution as 195 | provided in Section 3(a)(1)(A)(i). 196 | 197 | b. Other rights. 198 | 199 | 1. Moral rights, such as the right of integrity, are not 200 | licensed under this Public License, nor are publicity, 201 | privacy, and/or other similar personality rights; however, to 202 | the extent possible, the Licensor waives and/or agrees not to 203 | assert any such rights held by the Licensor to the limited 204 | extent necessary to allow You to exercise the Licensed 205 | Rights, but not otherwise. 206 | 207 | 2. Patent and trademark rights are not licensed under this 208 | Public License. 209 | 210 | 3. To the extent possible, the Licensor waives any right to 211 | collect royalties from You for the exercise of the Licensed 212 | Rights, whether directly or through a collecting society 213 | under any voluntary or waivable statutory or compulsory 214 | licensing scheme. In all other cases the Licensor expressly 215 | reserves any right to collect such royalties, including when 216 | the Licensed Material is used other than for NonCommercial 217 | purposes. 218 | 219 | Section 3 -- License Conditions. 220 | 221 | Your exercise of the Licensed Rights is expressly made subject to the 222 | following conditions. 223 | 224 | a. Attribution. 225 | 226 | 1. If You Share the Licensed Material (including in modified 227 | form), You must: 228 | 229 | a. retain the following if it is supplied by the Licensor 230 | with the Licensed Material: 231 | 232 | i. identification of the creator(s) of the Licensed 233 | Material and any others designated to receive 234 | attribution, in any reasonable manner requested by 235 | the Licensor (including by pseudonym if 236 | designated); 237 | 238 | ii. a copyright notice; 239 | 240 | iii. a notice that refers to this Public License; 241 | 242 | iv. a notice that refers to the disclaimer of 243 | warranties; 244 | 245 | v. a URI or hyperlink to the Licensed Material to the 246 | extent reasonably practicable; 247 | 248 | b. indicate if You modified the Licensed Material and 249 | retain an indication of any previous modifications; and 250 | 251 | c. indicate the Licensed Material is licensed under this 252 | Public License, and include the text of, or the URI or 253 | hyperlink to, this Public License. 254 | 255 | 2. You may satisfy the conditions in Section 3(a)(1) in any 256 | reasonable manner based on the medium, means, and context in 257 | which You Share the Licensed Material. For example, it may be 258 | reasonable to satisfy the conditions by providing a URI or 259 | hyperlink to a resource that includes the required 260 | information. 261 | 262 | 3. If requested by the Licensor, You must remove any of the 263 | information required by Section 3(a)(1)(A) to the extent 264 | reasonably practicable. 265 | 266 | 4. If You Share Adapted Material You produce, the Adapter's 267 | License You apply must not prevent recipients of the Adapted 268 | Material from complying with this Public License. 269 | 270 | Section 4 -- Sui Generis Database Rights. 271 | 272 | Where the Licensed Rights include Sui Generis Database Rights that 273 | apply to Your use of the Licensed Material: 274 | 275 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 276 | to extract, reuse, reproduce, and Share all or a substantial 277 | portion of the contents of the database for NonCommercial purposes 278 | only; 279 | 280 | b. if You include all or a substantial portion of the database 281 | contents in a database in which You have Sui Generis Database 282 | Rights, then the database in which You have Sui Generis Database 283 | Rights (but not its individual contents) is Adapted Material; and 284 | 285 | c. You must comply with the conditions in Section 3(a) if You Share 286 | all or a substantial portion of the contents of the database. 287 | 288 | For the avoidance of doubt, this Section 4 supplements and does not 289 | replace Your obligations under this Public License where the Licensed 290 | Rights include other Copyright and Similar Rights. 291 | 292 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 293 | 294 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 295 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 296 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 297 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 298 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 299 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 300 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 301 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 302 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 303 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 304 | 305 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 306 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 307 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 308 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 309 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 310 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 311 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 312 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 313 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 314 | 315 | c. The disclaimer of warranties and limitation of liability provided 316 | above shall be interpreted in a manner that, to the extent 317 | possible, most closely approximates an absolute disclaimer and 318 | waiver of all liability. 319 | 320 | Section 6 -- Term and Termination. 321 | 322 | a. This Public License applies for the term of the Copyright and 323 | Similar Rights licensed here. However, if You fail to comply with 324 | this Public License, then Your rights under this Public License 325 | terminate automatically. 326 | 327 | b. Where Your right to use the Licensed Material has terminated under 328 | Section 6(a), it reinstates: 329 | 330 | 1. automatically as of the date the violation is cured, provided 331 | it is cured within 30 days of Your discovery of the 332 | violation; or 333 | 334 | 2. upon express reinstatement by the Licensor. 335 | 336 | For the avoidance of doubt, this Section 6(b) does not affect any 337 | right the Licensor may have to seek remedies for Your violations 338 | of this Public License. 339 | 340 | c. For the avoidance of doubt, the Licensor may also offer the 341 | Licensed Material under separate terms or conditions or stop 342 | distributing the Licensed Material at any time; however, doing so 343 | will not terminate this Public License. 344 | 345 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 346 | License. 347 | 348 | Section 7 -- Other Terms and Conditions. 349 | 350 | a. The Licensor shall not be bound by any additional or different 351 | terms or conditions communicated by You unless expressly agreed. 352 | 353 | b. Any arrangements, understandings, or agreements regarding the 354 | Licensed Material not stated herein are separate from and 355 | independent of the terms and conditions of this Public License. 356 | 357 | Section 8 -- Interpretation. 358 | 359 | a. For the avoidance of doubt, this Public License does not, and 360 | shall not be interpreted to, reduce, limit, restrict, or impose 361 | conditions on any use of the Licensed Material that could lawfully 362 | be made without permission under this Public License. 363 | 364 | b. To the extent possible, if any provision of this Public License is 365 | deemed unenforceable, it shall be automatically reformed to the 366 | minimum extent necessary to make it enforceable. If the provision 367 | cannot be reformed, it shall be severed from this Public License 368 | without affecting the enforceability of the remaining terms and 369 | conditions. 370 | 371 | c. No term or condition of this Public License will be waived and no 372 | failure to comply consented to unless expressly agreed to by the 373 | Licensor. 374 | 375 | d. Nothing in this Public License constitutes or may be interpreted 376 | as a limitation upon, or waiver of, any privileges and immunities 377 | that apply to the Licensor or You, including from the legal 378 | processes of any jurisdiction or authority. 379 | 380 | ======================================================================= 381 | 382 | Creative Commons is not a party to its public 383 | licenses. Notwithstanding, Creative Commons may elect to apply one of 384 | its public licenses to material it publishes and in those instances 385 | will be considered the “Licensor.” The text of the Creative Commons 386 | public licenses is dedicated to the public domain under the CC0 Public 387 | Domain Dedication. Except for the limited purpose of indicating that 388 | material is shared under a Creative Commons public license or as 389 | otherwise permitted by the Creative Commons policies published at 390 | creativecommons.org/policies, Creative Commons does not authorize the 391 | use of the trademark "Creative Commons" or any other trademark or logo 392 | of Creative Commons without its prior written consent including, 393 | without limitation, in connection with any unauthorized modifications 394 | to any of its public licenses or any other arrangements, 395 | understandings, or agreements concerning use of licensed material. For 396 | the avoidance of doubt, this paragraph does not form part of the 397 | public licenses. 398 | 399 | Creative Commons may be contacted at creativecommons.org. 400 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Controllable Sentence Simplification 2 | 3 | This repository contains the original implementation of the ACCESS model (**A**udien**C**e-**CE**ntric **S**entence **S**implification) presented in [Controllable Sentence Simplification](https://arxiv.org/abs/1910.02677). 4 | 5 | The version that was used at submission time is on branch [submission](https://github.com/facebookresearch/access/tree/submission). 6 | 7 | 8 | ## Getting Started 9 | 10 | ### Dependencies 11 | 12 | * Python 3.6 13 | 14 | ### Installing 15 | 16 | ``` 17 | git clone git@github.com:facebookresearch/access.git 18 | cd access 19 | pip install -e . 20 | pip install --force-reinstall easse@git+git://github.com/feralvam/easse.git@580ec953e4742c3ae806cc85d867c16e9f584505 21 | pip install --force-reinstall fairseq@git+https://github.com/louismartin/fairseq.git@controllable-sentence-simplification 22 | 23 | pip install torch==1.2 24 | pip install sacrebleu==1.3.7 25 | ``` 26 | 27 | ### How to use 28 | 29 | Evaluate the pretrained model on WikiLarge: 30 | ``` 31 | python scripts/evaluate.py 32 | ``` 33 | 34 | Simplify text with the pretrained model 35 | ``` 36 | python scripts/generate.py < my_file.complex 37 | ``` 38 | 39 | Train a model 40 | ``` 41 | python scripts/train.py 42 | ``` 43 | 44 | ## Pretrained model 45 | 46 | The fairseq checkpoint of our model with the best scores can be found [here](http://dl.fbaipublicfiles.com/access/best_model.tar.gz). 47 | The model's output simplifications can be viewed on the [EASSE HTML report](http://htmlpreview.github.io/?https://github.com/facebookresearch/access/blob/master/system_output/easse_report.html). 48 | 49 | ## References 50 | 51 | If you use this code, please cite: 52 | L. Martin, B. Sagot, E. De la Clergerie, A. Bordes, [*Controllable Sentence Simplification*](https://arxiv.org/abs/1910.02677) 53 | 54 | ## Author 55 | 56 | If you have any question, please contact the author: 57 | **Louis Martin** ([louismartincs@gmail.com](mailto:louismartincs@gmail.com)) 58 | 59 | ## License 60 | 61 | See the [LICENSE](LICENSE) file for more details. 62 | -------------------------------------------------------------------------------- /access/evaluation/general.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from easse.cli import evaluate_system_output 9 | 10 | from access.preprocess import lowercase_file, to_lrb_rrb_file 11 | from access.resources.paths import get_data_filepath 12 | from access.utils.helpers import mute, get_temp_filepath 13 | '''A simplifier is a method with signature: simplifier(complex_filepath, output_pred_filepath)''' 14 | 15 | 16 | def get_prediction_on_turkcorpus(simplifier, phase): 17 | source_filepath = get_data_filepath('turkcorpus', phase, 'complex') 18 | pred_filepath = get_temp_filepath() 19 | with mute(): 20 | simplifier(source_filepath, pred_filepath) 21 | return pred_filepath 22 | 23 | 24 | def evaluate_simplifier_on_turkcorpus(simplifier, phase): 25 | pred_filepath = get_prediction_on_turkcorpus(simplifier, phase) 26 | pred_filepath = lowercase_file(pred_filepath) 27 | pred_filepath = to_lrb_rrb_file(pred_filepath) 28 | return evaluate_system_output(f'turkcorpus_{phase}_legacy', 29 | sys_sents_path=pred_filepath, 30 | metrics=['bleu', 'sari_legacy', 'fkgl'], 31 | quality_estimation=True) 32 | -------------------------------------------------------------------------------- /access/evaluation/utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from access.utils.helpers import harmonic_mean 9 | 10 | 11 | # Tranforms take a value and cast it to a score between 0 and 1, the higher the better 12 | def bleu_transform(bleu): 13 | min_bleu = 0 14 | max_bleu = 100 15 | bleu = max(bleu, min_bleu) 16 | bleu = min(bleu, max_bleu) 17 | return (bleu - min_bleu) / (max_bleu - min_bleu) 18 | 19 | 20 | def sari_transform(sari): 21 | min_sari = 0 22 | max_sari = 60 23 | sari = max(sari, min_sari) 24 | sari = min(sari, max_sari) 25 | return (sari - min_sari) / (max_sari - min_sari) 26 | 27 | 28 | def fkgl_transform(fkgl): 29 | min_fkgl = 0 30 | max_fkgl = 20 31 | fkgl = max(fkgl, min_fkgl) 32 | fkgl = min(fkgl, max_fkgl) 33 | return 1 - (fkgl - min_fkgl) / (max_fkgl - min_fkgl) 34 | 35 | 36 | def combine_metrics(bleu, sari, fkgl, coefs): 37 | # Combine into a score between 0 and 1, LOWER the better 38 | assert len(coefs) == 3 39 | return 1 - harmonic_mean([bleu_transform(bleu), sari_transform(sari), fkgl_transform(fkgl)], coefs) 40 | -------------------------------------------------------------------------------- /access/fairseq/base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from collections import defaultdict 9 | import os 10 | from pathlib import Path 11 | import random 12 | import re 13 | import shutil 14 | import tempfile 15 | import time 16 | 17 | from fairseq import options 18 | from fairseq_cli import preprocess, train, generate 19 | 20 | from access.resources.paths import get_dataset_dir, EXP_DIR 21 | from access.utils.helpers import (log_stdout, lock_directory, create_directory_or_skip, yield_lines, 22 | write_lines) 23 | 24 | 25 | def get_fairseq_exp_dir(job_id=None): 26 | if job_id is not None: 27 | dir_name = f'slurmjob_{job_id}' 28 | else: 29 | dir_name = f'local_{int(time.time() * 1000)}' 30 | return Path(EXP_DIR) / f'fairseq' / dir_name 31 | 32 | 33 | def fairseq_preprocess(dataset): 34 | dataset_dir = get_dataset_dir(dataset) 35 | with lock_directory(dataset_dir): 36 | preprocessed_dir = dataset_dir / 'fairseq_preprocessed' 37 | with create_directory_or_skip(preprocessed_dir): 38 | preprocessing_parser = options.get_preprocessing_parser() 39 | preprocess_args = preprocessing_parser.parse_args([ 40 | '--source-lang', 41 | 'complex', 42 | '--target-lang', 43 | 'simple', 44 | '--trainpref', 45 | os.path.join(dataset_dir, f'{dataset}.train'), 46 | '--validpref', 47 | os.path.join(dataset_dir, f'{dataset}.valid'), 48 | '--testpref', 49 | os.path.join(dataset_dir, f'{dataset}.test'), 50 | '--destdir', 51 | str(preprocessed_dir), 52 | '--output-format', 53 | 'raw', 54 | ]) 55 | preprocess.main(preprocess_args) 56 | return preprocessed_dir 57 | 58 | 59 | def fairseq_train( 60 | preprocessed_dir, 61 | exp_dir, 62 | ngpus=None, 63 | max_tokens=2000, 64 | arch='fconv_iwslt_de_en', 65 | pretrained_emb_path=None, 66 | embeddings_dim=None, 67 | # Transformer (decoder is the same as encoder for now) 68 | encoder_embed_dim=512, 69 | encoder_layers=6, 70 | encoder_attention_heads=8, 71 | # encoder_decoder_dim_ratio=1, 72 | # share_embeddings=True, 73 | max_epoch=50, 74 | warmup_updates=None, 75 | lr=0.1, 76 | min_lr=1e-9, 77 | dropout=0.2, 78 | label_smoothing=0.1, 79 | lr_scheduler='fixed', 80 | weight_decay=0.0001, 81 | criterion='label_smoothed_cross_entropy', 82 | optimizer='nag', 83 | validations_before_sari_early_stopping=10, 84 | fp16=False): 85 | exp_dir = Path(exp_dir) 86 | with log_stdout(exp_dir / 'fairseq_train.stdout'): 87 | preprocessed_dir = Path(preprocessed_dir) 88 | exp_dir.mkdir(exist_ok=True, parents=True) 89 | # Copy dictionaries to exp_dir for generation 90 | shutil.copy(preprocessed_dir / 'dict.complex.txt', exp_dir) 91 | shutil.copy(preprocessed_dir / 'dict.simple.txt', exp_dir) 92 | train_parser = options.get_training_parser() 93 | # if share_embeddings: 94 | # assert encoder_decoder_dim_ratio == 1 95 | args = [ 96 | '--task', 97 | 'translation', 98 | preprocessed_dir, 99 | '--raw-text', 100 | '--source-lang', 101 | 'complex', 102 | '--target-lang', 103 | 'simple', 104 | '--save-dir', 105 | os.path.join(exp_dir, 'checkpoints'), 106 | '--clip-norm', 107 | 0.1, 108 | '--criterion', 109 | criterion, 110 | '--no-epoch-checkpoints', 111 | '--save-interval-updates', 112 | 5000, # Validate every n updates 113 | '--validations-before-sari-early-stopping', 114 | validations_before_sari_early_stopping, 115 | '--arch', 116 | arch, 117 | 118 | # '--decoder-out-embed-dim', int(embeddings_dim * encoder_decoder_dim_ratio), # Output dim of decoder 119 | '--max-tokens', 120 | max_tokens, 121 | '--max-epoch', 122 | max_epoch, 123 | '--lr-scheduler', 124 | lr_scheduler, 125 | '--dropout', 126 | dropout, 127 | '--lr', 128 | lr, 129 | '--lr-shrink', 130 | 0.5, # For reduce lr on plateau scheduler 131 | '--min-lr', 132 | min_lr, 133 | '--weight-decay', 134 | weight_decay, 135 | '--optimizer', 136 | optimizer, 137 | '--label-smoothing', 138 | label_smoothing, 139 | '--seed', 140 | random.randint(1, 1000), 141 | # '--force-anneal', '200', 142 | # '--distributed-world-size', '1', 143 | ] 144 | if arch == 'transformer': 145 | args.extend([ 146 | '--encoder-embed-dim', 147 | encoder_embed_dim, 148 | '--encoder-ffn-embed-dim', 149 | 4 * encoder_embed_dim, 150 | '--encoder-layers', 151 | encoder_layers, 152 | '--encoder-attention-heads', 153 | encoder_attention_heads, 154 | '--decoder-layers', 155 | encoder_layers, 156 | '--decoder-attention-heads', 157 | encoder_attention_heads, 158 | ]) 159 | if pretrained_emb_path is not None: 160 | args.extend(['--encoder-embed-path', pretrained_emb_path if pretrained_emb_path is not None else '']) 161 | args.extend(['--decoder-embed-path', pretrained_emb_path if pretrained_emb_path is not None else '']) 162 | if embeddings_dim is not None: 163 | args.extend(['--encoder-embed-dim', embeddings_dim]) # Input and output dim of encoder 164 | args.extend(['--decoder-embed-dim', embeddings_dim]) # Input dim of decoder 165 | if ngpus is not None: 166 | args.extend(['--distributed-world-size', ngpus]) 167 | # if share_embeddings: 168 | # args.append('--share-input-output-embed') 169 | if fp16: 170 | args.append('--fp16') 171 | if warmup_updates is not None: 172 | args.extend(['--warmup-updates', warmup_updates]) 173 | args = [str(arg) for arg in args] 174 | train_args = options.parse_args_and_arch(train_parser, args) 175 | train.main(train_args) 176 | 177 | 178 | def _fairseq_generate(complex_filepath, 179 | output_pred_filepath, 180 | checkpoint_paths, 181 | complex_dictionary_path, 182 | simple_dictionary_path, 183 | beam=5, 184 | hypothesis_num=1, 185 | lenpen=1., 186 | diverse_beam_groups=None, 187 | diverse_beam_strength=0.5, 188 | sampling=False, 189 | batch_size=128): 190 | # exp_dir must contain checkpoints/checkpoint_best.pt, and dict.{complex,simple}.txt 191 | # First copy input complex file to exp_dir and create dummy simple file 192 | tmp_dir = Path(tempfile.mkdtemp()) 193 | new_complex_filepath = tmp_dir / 'tmp.complex-simple.complex' 194 | dummy_simple_filepath = tmp_dir / 'tmp.complex-simple.simple' 195 | shutil.copy(complex_filepath, new_complex_filepath) 196 | shutil.copy(complex_filepath, dummy_simple_filepath) 197 | shutil.copy(complex_dictionary_path, tmp_dir / 'dict.complex.txt') 198 | shutil.copy(simple_dictionary_path, tmp_dir / 'dict.simple.txt') 199 | generate_parser = options.get_generation_parser() 200 | args = [ 201 | tmp_dir, 202 | '--path', 203 | ':'.join([str(path) for path in checkpoint_paths]), 204 | '--beam', 205 | beam, 206 | '--nbest', 207 | hypothesis_num, 208 | '--lenpen', 209 | lenpen, 210 | '--diverse-beam-groups', 211 | diverse_beam_groups if diverse_beam_groups is not None else -1, 212 | '--diverse-beam-strength', 213 | diverse_beam_strength, 214 | '--batch-size', 215 | batch_size, 216 | '--raw-text', 217 | '--print-alignment', 218 | '--gen-subset', 219 | 'tmp', 220 | # We don't want to reload pretrained embeddings 221 | '--model-overrides', 222 | { 223 | 'encoder_embed_path': None, 224 | 'decoder_embed_path': None 225 | }, 226 | ] 227 | if sampling: 228 | args.extend([ 229 | '--sampling', 230 | '--sampling-topk', 231 | 10, 232 | ]) 233 | args = [str(arg) for arg in args] 234 | generate_args = options.parse_args_and_arch(generate_parser, args) 235 | out_filepath = tmp_dir / 'generation.out' 236 | with log_stdout(out_filepath, mute_stdout=True): 237 | # evaluate model in batch mode 238 | generate.main(generate_args) 239 | # Retrieve translations 240 | 241 | def parse_all_hypotheses(out_filepath): 242 | hypotheses_dict = defaultdict(list) 243 | for line in yield_lines(out_filepath): 244 | match = re.match(r'^H-(\d+)\t-?\d+\.\d+\t(.*)$', line) 245 | if match: 246 | sample_id, hypothesis = match.groups() 247 | hypotheses_dict[int(sample_id)].append(hypothesis) 248 | # Sort in original order 249 | return [hypotheses_dict[i] for i in range(len(hypotheses_dict))] 250 | 251 | all_hypotheses = parse_all_hypotheses(out_filepath) 252 | predictions = [hypotheses[hypothesis_num - 1] for hypotheses in all_hypotheses] 253 | write_lines(predictions, output_pred_filepath) 254 | os.remove(dummy_simple_filepath) 255 | os.remove(new_complex_filepath) 256 | 257 | 258 | def fairseq_generate(complex_filepath, 259 | output_pred_filepath, 260 | exp_dir, 261 | beam=1, 262 | hypothesis_num=1, 263 | lenpen=1., 264 | diverse_beam_groups=None, 265 | diverse_beam_strength=0.5, 266 | sampling=False, 267 | batch_size=128): 268 | exp_dir = Path(exp_dir) 269 | checkpoint_path = exp_dir / 'checkpoints/checkpoint_best.pt' 270 | assert checkpoint_path.exists(), f'Generation failed, no checkpoint at {checkpoint_path}' 271 | complex_dictionary_path = exp_dir / 'dict.complex.txt' 272 | simple_dictionary_path = exp_dir / 'dict.simple.txt' 273 | _fairseq_generate(complex_filepath, 274 | output_pred_filepath, [checkpoint_path], 275 | complex_dictionary_path=complex_dictionary_path, 276 | simple_dictionary_path=simple_dictionary_path, 277 | beam=beam, 278 | hypothesis_num=hypothesis_num, 279 | lenpen=lenpen, 280 | diverse_beam_groups=diverse_beam_groups, 281 | diverse_beam_strength=diverse_beam_strength, 282 | sampling=sampling, 283 | batch_size=batch_size) 284 | -------------------------------------------------------------------------------- /access/fairseq/main.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from collections import defaultdict 9 | from functools import lru_cache 10 | import shutil 11 | 12 | from nevergrad.instrumentation import Instrumentation 13 | from nevergrad.optimization import optimizerlib 14 | import re 15 | 16 | from access.evaluation.general import evaluate_simplifier_on_turkcorpus 17 | from access.evaluation.utils import combine_metrics 18 | from access.fairseq.base import (fairseq_preprocess, fairseq_train, fairseq_generate, get_fairseq_exp_dir, 19 | ) 20 | from access.resources.datasets import has_lines_in_common 21 | from access.preprocessors import get_preprocessors, get_preprocessor_by_name 22 | from access.resources.datasets import create_preprocessed_dataset 23 | from access.resources.paths import get_data_filepath, get_dataset_dir 24 | from access.simplifiers import get_fairseq_simplifier, get_preprocessed_simplifier 25 | from access.utils.training import (print_method_name, print_args, print_result, print_running_time, 26 | ) 27 | from access.utils.helpers import get_allowed_kwargs 28 | 29 | 30 | def check_dataset(dataset): 31 | # Sanity check with evaluation dataset 32 | assert not has_lines_in_common(get_data_filepath(dataset, 'train', 'complex'), 33 | get_data_filepath('turkcorpus', 'valid', 'complex')) 34 | assert not has_lines_in_common(get_data_filepath(dataset, 'train', 'complex'), 35 | get_data_filepath('turkcorpus', 'test', 'complex')) 36 | 37 | 38 | def prepare_exp_dir(): 39 | exp_dir = get_fairseq_exp_dir() 40 | if exp_dir.exists(): 41 | # Remove exp dir to prevent conflicts with requeue and non deterministic args 42 | # https://github.com/fairinternal/dfoptim/issues/126 #private 43 | shutil.rmtree(exp_dir) 44 | exp_dir.mkdir(parents=True) 45 | return exp_dir 46 | 47 | 48 | def get_simplifier(exp_dir, preprocessors_kwargs, generate_kwargs): 49 | # TODO: Take kwargs as input and separate between get_preprocessors kwargs and generate_kwargs 50 | preprocessors = get_preprocessors(preprocessors_kwargs) 51 | simplifier = get_fairseq_simplifier(exp_dir, **generate_kwargs) 52 | return get_preprocessed_simplifier(simplifier, preprocessors=preprocessors) 53 | 54 | 55 | def find_best_parametrization(exp_dir, metrics_coefs, preprocessors_kwargs, parametrization_budget=64): 56 | @lru_cache() 57 | def evaluate_parametrization(**instru_kwargs): 58 | # Note that we use default generate kwargs instead of provided one because they are faster 59 | preprocessors_kwargs = instru_kwargs_to_preprocessors_kwargs(instru_kwargs) 60 | simplifier = get_simplifier(exp_dir, preprocessors_kwargs=preprocessors_kwargs, generate_kwargs={}) 61 | scores = evaluate_simplifier_on_turkcorpus(simplifier, phase='valid') 62 | return combine_metrics(scores['BLEU'], scores['SARI'], scores['FKGL'], metrics_coefs) 63 | 64 | def preprocessors_kwargs_to_instru_kwargs(preprocessors_kwargs): 65 | instru_kwargs = {} 66 | for preprocessor_name, preprocessor_kwargs in preprocessors_kwargs.items(): 67 | assert '_' not in preprocessor_name 68 | preprocessor = get_preprocessor_by_name(preprocessor_name)(**preprocessor_kwargs) 69 | # First we set the values from preprocessors_kwargs which are constant 70 | for kwarg_name, kwarg_value in preprocessor_kwargs.items(): 71 | instru_kwargs[f'{preprocessor_name}_{kwarg_name}'] = kwarg_value 72 | # Then we overwrite some of these values with nevergrad variables when necessary 73 | for kwarg_name, kwarg_value in preprocessor.get_nevergrad_variables().items(): 74 | instru_kwargs[f'{preprocessor_name}_{kwarg_name}'] = kwarg_value 75 | return instru_kwargs 76 | 77 | def instru_kwargs_to_preprocessors_kwargs(instru_kwargs): 78 | preprocessors_kwargs = defaultdict(dict) 79 | for key, value in instru_kwargs.items(): 80 | preprocessor_name, kwarg_name = re.match(r'([a-zA-Z0-9]+)_([a-z0-9_]+)', key).groups() 81 | preprocessors_kwargs[preprocessor_name][kwarg_name] = value 82 | return dict(preprocessors_kwargs) 83 | 84 | instru_kwargs = preprocessors_kwargs_to_instru_kwargs(preprocessors_kwargs) 85 | instru = Instrumentation(**instru_kwargs) 86 | if instru.dimension == 0: 87 | return preprocessors_kwargs 88 | # No need to search a lot when there is only a few parameters 89 | parametrization_budget = min(32**instru.dimension, parametrization_budget) 90 | optimizer = optimizerlib.ScrHammersleySearch(instrumentation=instru, budget=parametrization_budget, num_workers=1) 91 | recommendation = optimizer.optimize(evaluate_parametrization, verbosity=0) 92 | return instru_kwargs_to_preprocessors_kwargs(recommendation.kwargs) 93 | 94 | 95 | def check_and_resolve_args(kwargs): 96 | if kwargs.get('diverse_beam_groups_ratio', None) is not None: 97 | diverse_beam_groups = max(int(kwargs['beam'] * kwargs['diverse_beam_groups_ratio']), 1) 98 | print(f'diverse_beam_groups={diverse_beam_groups}') 99 | assert kwargs['beam'] % diverse_beam_groups == 0 100 | kwargs['diverse_beam_groups'] = diverse_beam_groups 101 | else: 102 | diverse_beam_groups = None 103 | return kwargs 104 | 105 | 106 | @print_method_name 107 | @print_args 108 | @print_result 109 | @print_running_time 110 | def fairseq_train_and_evaluate(dataset, metrics_coefs=[1, 1, 1], parametrization_budget=64, **kwargs): 111 | check_dataset(dataset) 112 | kwargs = check_and_resolve_args(kwargs) 113 | exp_dir = prepare_exp_dir() 114 | preprocessors_kwargs = kwargs.get('preprocessors_kwargs', {}) 115 | preprocessors = get_preprocessors(preprocessors_kwargs) 116 | if len(preprocessors) > 0: 117 | dataset = create_preprocessed_dataset(dataset, preprocessors, n_jobs=1) 118 | shutil.copy(get_dataset_dir(dataset) / 'preprocessors.pickle', exp_dir) 119 | preprocessed_dir = fairseq_preprocess(dataset) 120 | train_kwargs = get_allowed_kwargs(fairseq_train, preprocessed_dir, exp_dir, **kwargs) 121 | fairseq_train(preprocessed_dir, exp_dir=exp_dir, **train_kwargs) 122 | # Evaluation 123 | generate_kwargs = get_allowed_kwargs(fairseq_generate, 'complex_filepath', 'pred_filepath', exp_dir, **kwargs) 124 | recommended_preprocessors_kwargs = find_best_parametrization(exp_dir, metrics_coefs, preprocessors_kwargs, 125 | parametrization_budget) 126 | print(f'recommended_preprocessors_kwargs={recommended_preprocessors_kwargs}') 127 | simplifier = get_simplifier(exp_dir, recommended_preprocessors_kwargs, generate_kwargs) 128 | scores = evaluate_simplifier_on_turkcorpus(simplifier, phase='valid') 129 | print(f'scores={scores}') 130 | score = combine_metrics(scores['BLEU'], scores['SARI'], scores['FKGL'], metrics_coefs) 131 | return score 132 | -------------------------------------------------------------------------------- /access/feature_extraction.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from functools import lru_cache 9 | 10 | import Levenshtein 11 | import numpy as np 12 | 13 | from access.resources.paths import FASTTEXT_EMBEDDINGS_PATH 14 | from access.resources.prepare import prepare_fasttext_embeddings 15 | from access.text import (to_words, remove_punctuation_tokens, remove_stopwords, spacy_process) 16 | from access.utils.helpers import yield_lines 17 | 18 | 19 | @lru_cache(maxsize=1) 20 | def get_word2rank(vocab_size=np.inf): 21 | prepare_fasttext_embeddings() 22 | # TODO: Decrease vocab size or load from smaller file 23 | word2rank = {} 24 | line_generator = yield_lines(FASTTEXT_EMBEDDINGS_PATH) 25 | next(line_generator) # Skip the first line (header) 26 | for i, line in enumerate(line_generator): 27 | if (i + 1) > vocab_size: 28 | break 29 | word = line.split(' ')[0] 30 | word2rank[word] = i 31 | return word2rank 32 | 33 | 34 | def get_rank(word): 35 | return get_word2rank().get(word, len(get_word2rank())) 36 | 37 | 38 | def get_log_rank(word): 39 | return np.log(1 + get_rank(word)) 40 | 41 | 42 | def get_lexical_complexity_score(sentence): 43 | words = to_words(remove_stopwords(remove_punctuation_tokens(sentence))) 44 | words = [word for word in words if word in get_word2rank()] 45 | if len(words) == 0: 46 | return np.log(1 + len(get_word2rank())) # TODO: This is completely arbitrary 47 | return np.quantile([get_log_rank(word) for word in words], 0.75) 48 | 49 | 50 | def get_levenshtein_similarity(complex_sentence, simple_sentence): 51 | return Levenshtein.ratio(complex_sentence, simple_sentence) 52 | 53 | 54 | def get_dependency_tree_depth(sentence): 55 | def get_subtree_depth(node): 56 | if len(list(node.children)) == 0: 57 | return 0 58 | return 1 + max([get_subtree_depth(child) for child in node.children]) 59 | 60 | tree_depths = [get_subtree_depth(spacy_sentence.root) for spacy_sentence in spacy_process(sentence).sents] 61 | if len(tree_depths) == 0: 62 | return 0 63 | return max(tree_depths) 64 | -------------------------------------------------------------------------------- /access/preprocess.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from functools import wraps 9 | import multiprocessing 10 | import random 11 | import re 12 | 13 | from joblib import Parallel, delayed 14 | import torch 15 | 16 | from access.text import to_words 17 | from access.utils.helpers import (open_files, yield_lines, yield_lines_in_parallel, get_temp_filepath, delete_files, 18 | get_temp_filepaths) 19 | 20 | 21 | def apply_line_method_to_file(line_method, input_filepath): 22 | output_filepath = get_temp_filepath() 23 | with open(input_filepath, 'r') as input_file, open(output_filepath, 'w') as output_file: 24 | for line in input_file: 25 | transformed_line = line_method(line.rstrip('\n')) 26 | if transformed_line is not None: 27 | output_file.write(transformed_line + '\n') 28 | return output_filepath 29 | 30 | 31 | def replace_lrb_rrb(text): 32 | text = re.sub(r'-lrb-', '(', text, flags=re.IGNORECASE) 33 | text = re.sub(r'-rrb-', ')', text, flags=re.IGNORECASE) 34 | text = re.sub(r'-lsb-', '[', text, flags=re.IGNORECASE) 35 | text = re.sub(r'-rsb-', ']', text, flags=re.IGNORECASE) 36 | text = re.sub(r'-lcb-', '{', text, flags=re.IGNORECASE) 37 | text = re.sub(r'-rcb-', '}', text, flags=re.IGNORECASE) 38 | return text 39 | 40 | 41 | def replace_lrb_rrb_file(filepath): 42 | return apply_line_method_to_file(replace_lrb_rrb, filepath) 43 | 44 | 45 | def to_lrb_rrb(text): 46 | # TODO: Very basic 47 | text = re.sub(r'((^| ))\( ', r'\1-lrb- ', text) 48 | text = re.sub(r' \)((^| ))', r' -rrb-\1', text) 49 | return text 50 | 51 | 52 | def replace_back_quotes(text): 53 | return text.replace('`', "'") 54 | 55 | 56 | def replace_double_quotes(text): 57 | return text.replace("''", '"') 58 | 59 | 60 | def normalize_quotes(text): 61 | return replace_double_quotes(replace_back_quotes(text)) 62 | 63 | 64 | def to_lrb_rrb_file(input_filepath): 65 | return apply_line_method_to_file(to_lrb_rrb, input_filepath) 66 | 67 | 68 | def lowercase_file(filepath): 69 | return apply_line_method_to_file(lambda line: line.lower(), filepath) 70 | 71 | 72 | def concatenate_files(input_filepaths, output_filepath): 73 | with open(output_filepath, 'w') as output_f: 74 | for input_file in input_filepaths: 75 | with open(input_file, 'r') as input_f: 76 | for line in input_f: 77 | output_f.write(line) 78 | 79 | 80 | def split_file(input_filepath, output_filepaths, round_robin=False): 81 | if not round_robin: 82 | raise NotImplementedError('Splitting files is only implemented as round robin.') 83 | with open_files(output_filepaths, 'w') as files: 84 | # We write each line to a different file in a round robin fashion 85 | for i, line in enumerate(yield_lines(input_filepath)): 86 | files[i % len(output_filepaths)].write(line + '\n') 87 | 88 | 89 | def merge_files(input_filepaths, output_filepath, round_robin=False): 90 | if not round_robin: 91 | return concatenate_files(input_filepaths, output_filepath) 92 | with open(output_filepath, 'w') as f: 93 | for lines in yield_lines_in_parallel(input_filepaths, strict=False): 94 | for line in lines: 95 | if line is None: 96 | return 97 | f.write(line + '\n') 98 | 99 | 100 | def get_real_n_jobs(n_jobs): 101 | n_cpus = multiprocessing.cpu_count() 102 | if n_jobs < 0: 103 | # Adopt same logic as joblib 104 | n_jobs = n_cpus + 1 + n_jobs 105 | if n_jobs > n_cpus: 106 | print('Setting n_jobs={n_jobs} > n_cpus={n_cpus}, setting n_jobs={n_cpus}') 107 | n_jobs = n_cpus 108 | assert 0 < n_jobs <= n_cpus 109 | return n_jobs 110 | 111 | 112 | def get_parallel_file_pair_preprocessor(file_pair_preprocessor, n_jobs): 113 | if n_jobs == 1: 114 | return file_pair_preprocessor 115 | n_jobs = get_real_n_jobs(n_jobs) 116 | 117 | @wraps(file_pair_preprocessor) 118 | def parallel_file_pair_preprocessor(complex_filepath, simple_filepath, output_complex_filepath, 119 | output_simple_filepath): 120 | temp_complex_filepaths = get_temp_filepaths(n_jobs) 121 | temp_simple_filepaths = get_temp_filepaths(n_jobs) 122 | split_file(complex_filepath, temp_complex_filepaths, round_robin=True) 123 | split_file(simple_filepath, temp_simple_filepaths, round_robin=True) 124 | preprocessed_temp_complex_filepaths = get_temp_filepaths(n_jobs) 125 | preprocessed_temp_simple_filepaths = get_temp_filepaths(n_jobs) 126 | tasks = [ 127 | delayed(file_pair_preprocessor)(*paths) 128 | for paths in zip(temp_complex_filepaths, temp_simple_filepaths, preprocessed_temp_complex_filepaths, 129 | preprocessed_temp_simple_filepaths) 130 | ] 131 | Parallel(n_jobs=n_jobs)(tasks) 132 | merge_files(preprocessed_temp_complex_filepaths, output_complex_filepath, round_robin=True) 133 | merge_files(preprocessed_temp_simple_filepaths, output_simple_filepath, round_robin=True) 134 | delete_files(temp_complex_filepaths) 135 | delete_files(temp_simple_filepaths) 136 | delete_files(preprocessed_temp_complex_filepaths) 137 | delete_files(preprocessed_temp_simple_filepaths) 138 | 139 | return parallel_file_pair_preprocessor 140 | 141 | 142 | def word_shuffle(words, max_swap=3): 143 | noise = torch.rand(len(words)).mul_(max_swap) 144 | permutation = torch.arange(len(words)).float().add_(noise).sort()[1] 145 | return [words[i] for i in permutation] 146 | 147 | 148 | def word_dropout(words, dropout_prob=0.1): 149 | keep = torch.rand(len(words)) 150 | dropped_out_words = [word for i, word in enumerate(words) if keep[i] > dropout_prob] 151 | if len(dropped_out_words) == 0: 152 | return [words[random.randint(0, len(words) - 1)]] 153 | return dropped_out_words 154 | 155 | 156 | def word_blank(words, blank_prob=0.1): 157 | keep = torch.rand(len(words)) 158 | return [word if keep[i] > blank_prob else '' for i, word in enumerate(words)] 159 | 160 | 161 | def add_noise(sentence): 162 | words = to_words(sentence) 163 | words = word_shuffle(words, max_swap=3) 164 | words = word_dropout(words, dropout_prob=0.1) 165 | words = word_blank(words, blank_prob=0.1) 166 | return ' '.join(words) 167 | -------------------------------------------------------------------------------- /access/preprocessors.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from abc import ABC 9 | from functools import wraps, lru_cache 10 | import hashlib 11 | from pathlib import Path 12 | import dill as pickle 13 | import re 14 | import shutil 15 | 16 | from nevergrad.instrumentation import var 17 | import numpy as np 18 | import sentencepiece as spm 19 | 20 | from access.feature_extraction import (get_lexical_complexity_score, get_levenshtein_similarity, 21 | get_dependency_tree_depth) 22 | from access.resources.paths import VARIOUS_DIR, get_data_filepath 23 | from access.utils.helpers import (write_lines_in_parallel, yield_lines_in_parallel, add_dicts, get_default_args, 24 | get_temp_filepath, safe_division, count_lines) 25 | 26 | SPECIAL_TOKEN_REGEX = r'<[a-zA-Z\-_\d\.]+>' 27 | PREPROCESSORS_REGISTRY = {} 28 | 29 | 30 | def get_preprocessor_by_name(preprocessor_name): 31 | return PREPROCESSORS_REGISTRY[preprocessor_name] 32 | 33 | 34 | def get_preprocessors(preprocessor_kwargs): 35 | preprocessors = [] 36 | for preprocessor_name, kwargs in preprocessor_kwargs.items(): 37 | preprocessors.append(get_preprocessor_by_name(preprocessor_name)(**kwargs)) 38 | return preprocessors 39 | 40 | 41 | def extract_special_tokens(sentence): 42 | '''Remove any number of token at the beginning of the sentence''' 43 | match = re.match(fr'(^(?:{SPECIAL_TOKEN_REGEX} *)+) *(.*)$', sentence) 44 | if match is None: 45 | return '', sentence 46 | special_tokens, sentence = match.groups() 47 | return special_tokens.strip(), sentence 48 | 49 | 50 | def remove_special_tokens(sentence): 51 | return extract_special_tokens(sentence)[1] 52 | 53 | 54 | def store_args(constructor): 55 | @wraps(constructor) 56 | def wrapped(self, *args, **kwargs): 57 | if not hasattr(self, 'args') or not hasattr(self, 'kwargs'): 58 | # TODO: Default args are not overwritten if provided as args 59 | self.args = args 60 | self.kwargs = add_dicts(get_default_args(constructor), kwargs) 61 | return constructor(self, *args, **kwargs) 62 | 63 | return wrapped 64 | 65 | 66 | def dump_preprocessors(preprocessors, dir_path): 67 | with open(Path(dir_path) / 'preprocessors.pickle', 'wb') as f: 68 | pickle.dump(preprocessors, f) 69 | 70 | 71 | def load_preprocessors(dir_path): 72 | path = Path(dir_path) / 'preprocessors.pickle' 73 | if not path.exists(): 74 | return None 75 | with open(path, 'rb') as f: 76 | return pickle.load(f) 77 | 78 | 79 | class AbstractPreprocessor(ABC): 80 | def __init_subclass__(cls, **kwargs): 81 | '''Register all children in registry''' 82 | super().__init_subclass__(**kwargs) 83 | PREPROCESSORS_REGISTRY[cls.__name__] = cls 84 | 85 | def __repr__(self): 86 | args = getattr(self, 'args', ()) 87 | kwargs = getattr(self, 'kwargs', {}) 88 | args_repr = [repr(arg) for arg in args] 89 | kwargs_repr = [f'{k}={repr(v)}' for k, v in sorted(kwargs.items(), key=lambda kv: kv[0])] 90 | args_kwargs_str = ', '.join(args_repr + kwargs_repr) 91 | return f'{self.__class__.__name__}({args_kwargs_str})' 92 | 93 | def get_hash_string(self): 94 | return self.__class__.__name__ 95 | 96 | def get_hash(self): 97 | return hashlib.md5(self.get_hash_string().encode()).hexdigest() 98 | 99 | def get_nevergrad_variables(self): 100 | return {} 101 | 102 | @property 103 | def prefix(self): 104 | return self.__class__.__name__.replace('Preprocessor', '') 105 | 106 | def fit(self, complex_filepath, simple_filepath): 107 | pass 108 | 109 | def encode_sentence(self, sentence, encoder_sentence=None): 110 | raise NotImplementedError 111 | 112 | def decode_sentence(self, sentence, encoder_sentence=None): 113 | raise NotImplementedError 114 | 115 | def encode_sentence_pair(self, complex_sentence, simple_sentence): 116 | if complex_sentence is not None: 117 | complex_sentence = self.encode_sentence(complex_sentence) 118 | if simple_sentence is not None: 119 | simple_sentence = self.encode_sentence(simple_sentence) 120 | return complex_sentence, simple_sentence 121 | 122 | def encode_file(self, input_filepath, output_filepath, encoder_filepath=None): 123 | if encoder_filepath is None: 124 | # We will use an empty temporary file which will yield None for each line 125 | encoder_filepath = get_temp_filepath(create=True) 126 | with open(output_filepath, 'w') as f: 127 | for input_line, encoder_line in yield_lines_in_parallel([input_filepath, encoder_filepath], strict=False): 128 | f.write(self.encode_sentence(input_line, encoder_line) + '\n') 129 | 130 | def decode_file(self, input_filepath, output_filepath, encoder_filepath=None): 131 | if encoder_filepath is None: 132 | # We will use an empty temporary file which will yield None for each line 133 | encoder_filepath = get_temp_filepath(create=True) 134 | with open(output_filepath, 'w') as f: 135 | for encoder_sentence, input_sentence in yield_lines_in_parallel([encoder_filepath, input_filepath], 136 | strict=False): 137 | decoded_sentence = self.decode_sentence(input_sentence, encoder_sentence=encoder_sentence) 138 | f.write(decoded_sentence + '\n') 139 | 140 | def encode_file_pair(self, complex_filepath, simple_filepath, output_complex_filepath, output_simple_filepath): 141 | '''Jointly encode a complex file and a simple file (can be aligned or not)''' 142 | with write_lines_in_parallel([output_complex_filepath, output_simple_filepath], strict=False) as output_files: 143 | for complex_line, simple_line in yield_lines_in_parallel([complex_filepath, simple_filepath], strict=False): 144 | output_files.write(self.encode_sentence_pair(complex_line, simple_line)) 145 | 146 | 147 | class ComposedPreprocessor(AbstractPreprocessor): 148 | @store_args 149 | def __init__(self, preprocessors, sort=False): 150 | if preprocessors is None: 151 | preprocessors = [] 152 | if sort: 153 | # Make sure preprocessors are always in the same order 154 | preprocessors = sorted(preprocessors, key=lambda preprocessor: preprocessor.__class__.__name__) 155 | self.preprocessors = preprocessors 156 | 157 | def get_hash_string(self): 158 | preprocessors_hash_strings = [preprocessor.get_hash_string() for preprocessor in self.preprocessors] 159 | return f'ComposedPreprocessor(preprocessors={preprocessors_hash_strings})' 160 | 161 | def get_suffix(self): 162 | return '_'.join([p.prefix.lower() for p in self.preprocessors]) 163 | 164 | def fit(self, complex_filepath, simple_filepath): 165 | for preprocessor in self.preprocessors: 166 | pass 167 | 168 | def encode_sentence(self, sentence, encoder_sentence=None): 169 | for preprocessor in self.preprocessors: 170 | sentence = preprocessor.encode_sentence(sentence, encoder_sentence) 171 | return sentence 172 | 173 | def decode_sentence(self, sentence, encoder_sentence=None): 174 | for preprocessor in self.preprocessors: 175 | sentence = preprocessor.decode_sentence(sentence, encoder_sentence) 176 | return sentence 177 | 178 | def encode_file(self, input_filepath, output_filepath, encoder_filepath=None): 179 | for preprocessor in self.preprocessors: 180 | intermediary_output_filepath = get_temp_filepath() 181 | preprocessor.encode_file(input_filepath, intermediary_output_filepath, encoder_filepath) 182 | input_filepath = intermediary_output_filepath 183 | shutil.copyfile(input_filepath, output_filepath) 184 | 185 | def decode_file(self, input_filepath, output_filepath, encoder_filepath=None): 186 | for preprocessor in self.preprocessors: 187 | intermediary_output_filepath = get_temp_filepath() 188 | preprocessor.decode_file(input_filepath, intermediary_output_filepath, encoder_filepath) 189 | input_filepath = intermediary_output_filepath 190 | shutil.copyfile(input_filepath, output_filepath) 191 | 192 | def encode_file_pair(self, complex_filepath, simple_filepath, output_complex_filepath, output_simple_filepath): 193 | for preprocessor in self.preprocessors: 194 | intermediary_output_complex_filepath = get_temp_filepath() 195 | intermediary_output_simple_filepath = get_temp_filepath() 196 | preprocessor.encode_file_pair(complex_filepath, simple_filepath, intermediary_output_complex_filepath, 197 | intermediary_output_simple_filepath) 198 | complex_filepath = intermediary_output_complex_filepath 199 | simple_filepath = intermediary_output_simple_filepath 200 | shutil.copyfile(complex_filepath, output_complex_filepath) 201 | shutil.copyfile(simple_filepath, output_simple_filepath) 202 | 203 | def encode_sentence_pair(self, complex_sentence, simple_sentence): 204 | for preprocessor in self.preprocessors: 205 | complex_sentence, simple_sentence = preprocessor.encode_sentence_pair(complex_sentence, simple_sentence) 206 | return complex_sentence, simple_sentence 207 | 208 | 209 | class FeaturePreprocessor(AbstractPreprocessor): 210 | '''Prepend a computed feature at the beginning of the sentence''' 211 | @store_args 212 | def __init__(self, feature_name, get_feature_value, get_target_feature_value, bucket_size=0.05, noise_std=0): 213 | self.get_feature_value = get_feature_value 214 | self.get_target_feature_value = get_target_feature_value 215 | self.bucket_size = bucket_size 216 | self.noise_std = noise_std 217 | self.feature_name = feature_name.upper() 218 | 219 | def get_hash_string(self): 220 | return (f'{self.__class__.__name__}(feature_name={repr(self.feature_name)}, bucket_size={self.bucket_size},' 221 | f'noise_std={self.noise_std})') 222 | 223 | def bucketize(self, value): 224 | '''Round value to bucket_size to reduce the number of different values''' 225 | return round(round(value / self.bucket_size) * self.bucket_size, 10) 226 | 227 | def add_noise(self, value): 228 | return value + np.random.normal(0, self.noise_std) 229 | 230 | def get_feature_token(self, feature_value): 231 | return f'<{self.feature_name}_{feature_value}>' 232 | 233 | def encode_sentence(self, sentence, encoder_sentence=None): 234 | desired_feature = self.bucketize(self.get_target_feature_value(remove_special_tokens(sentence))) 235 | return f'{self.get_feature_token(desired_feature)} {sentence}' 236 | 237 | def decode_sentence(self, sentence, encoder_sentence=None): 238 | return sentence 239 | 240 | def encode_sentence_pair(self, complex_sentence, simple_sentence): 241 | feature = self.bucketize( 242 | self.add_noise( 243 | self.get_feature_value(remove_special_tokens(complex_sentence), 244 | remove_special_tokens(simple_sentence)))) 245 | return f'{self.get_feature_token(feature)} {complex_sentence}', simple_sentence 246 | 247 | 248 | class LevenshteinPreprocessor(FeaturePreprocessor): 249 | @store_args 250 | def __init__(self, target_ratio=0.8, bucket_size=0.05, noise_std=0): 251 | self.target_ratio = target_ratio 252 | super().__init__(self.prefix.upper(), self.get_feature_value, self.get_target_feature_value, bucket_size, 253 | noise_std) 254 | 255 | def get_nevergrad_variables(self): 256 | return {'target_ratio': var.OrderedDiscrete(np.arange(0.4, 1 + 1e-6, self.bucket_size))} 257 | 258 | def get_feature_value(self, complex_sentence, simple_sentence): 259 | return get_levenshtein_similarity(complex_sentence, simple_sentence) 260 | 261 | def get_target_feature_value(self, complex_sentence): 262 | return self.target_ratio 263 | 264 | 265 | class RatioPreprocessor(FeaturePreprocessor): 266 | @store_args 267 | def __init__(self, feature_extractor, target_ratio=0.8, bucket_size=0.05, noise_std=0): 268 | self.feature_extractor = feature_extractor 269 | self.target_ratio = target_ratio 270 | super().__init__(self.prefix.upper(), self.get_feature_value, self.get_target_feature_value, bucket_size, 271 | noise_std) 272 | 273 | def get_nevergrad_variables(self): 274 | return {'target_ratio': var.OrderedDiscrete(np.arange(0.4, 1.4 + 1e-6, self.bucket_size))} 275 | 276 | def get_feature_value(self, complex_sentence, simple_sentence): 277 | return min(safe_division(self.feature_extractor(simple_sentence), self.feature_extractor(complex_sentence)), 2) 278 | 279 | def get_target_feature_value(self, complex_sentence): 280 | return self.target_ratio 281 | 282 | 283 | class LengthRatioPreprocessor(RatioPreprocessor): 284 | @store_args 285 | def __init__(self, *args, **kwargs): 286 | super().__init__(len, *args, **kwargs) 287 | 288 | 289 | class WordRankRatioPreprocessor(RatioPreprocessor): 290 | @store_args 291 | def __init__(self, *args, **kwargs): 292 | super().__init__(get_lexical_complexity_score, *args, **kwargs) 293 | 294 | 295 | class DependencyTreeDepthRatioPreprocessor(RatioPreprocessor): 296 | @store_args 297 | def __init__(self, *args, **kwargs): 298 | super().__init__(get_dependency_tree_depth, *args, **kwargs) 299 | 300 | 301 | class SentencePiecePreprocessor(AbstractPreprocessor): 302 | @store_args 303 | def __init__(self, vocab_size=10000, input_filepaths=None): 304 | self.vocab_size = vocab_size 305 | self.sentencepiece_model_path = VARIOUS_DIR / f'sentencepiece_model/sentencepiece_model_{self.vocab_size}.model' 306 | self.input_filepaths = input_filepaths 307 | if self.input_filepaths is None: 308 | self.input_filepaths = [ 309 | get_data_filepath('wikilarge', 'train', 'complex'), 310 | get_data_filepath('wikilarge', 'train', 'simple') 311 | ] 312 | self.learn_sentencepiece() 313 | 314 | @property 315 | @lru_cache(maxsize=1) 316 | def sp(self): 317 | ''' 318 | We need to use a property because SentencenPieceProcessor is cannot pickled 319 | > pickle.dumps(spm.SentencePieceProcessor()) 320 | ----> TypeError: can't pickle SwigPyObject objects 321 | ''' 322 | sp = spm.SentencePieceProcessor() 323 | sp.Load(str(self.sentencepiece_model_path)) 324 | return sp 325 | 326 | def get_hash_string(self): 327 | return f'{self.__class__.__name__}(vocab_size={self.vocab_size})' 328 | 329 | def learn_sentencepiece(self): 330 | if self.sentencepiece_model_path.exists(): 331 | return 332 | self.sentencepiece_model_path.parent.mkdir(parents=True, exist_ok=True) 333 | sentencepiece_model_prefix = self.sentencepiece_model_path.parent / self.sentencepiece_model_path.stem 334 | args_str = ' '.join([ 335 | f'--input={",".join([str(path) for path in self.input_filepaths])}', 336 | f'--model_prefix={sentencepiece_model_prefix}', 337 | f'--vocab_size={self.vocab_size}', 338 | ]) 339 | max_lines = 10**6 340 | if sum([count_lines(filepath) for filepath in self.input_filepaths]) > max_lines: 341 | args_str += f' --input_sentence_size={max_lines} --shuffle_input_sentence=true' 342 | spm.SentencePieceTrainer.Train(args_str) 343 | 344 | def fit(self, complex_filepath, simple_filepath): 345 | # Args are not used 346 | self.learn_sentencepiece() 347 | 348 | def encode_sentence(self, sentence, encoder_sentence=None): 349 | # TODO: Do we really need to extract the tokens 350 | special_tokens, sentence = extract_special_tokens(sentence) 351 | encoded_sentence = ' '.join(self.sp.EncodeAsPieces(sentence)) 352 | if special_tokens != '': 353 | encoded_sentence = f'{special_tokens} {encoded_sentence}' 354 | return encoded_sentence 355 | 356 | def decode_sentence(self, sentence, encoder_sentence=None): 357 | return self.sp.DecodePieces(sentence.split(' ')) 358 | -------------------------------------------------------------------------------- /access/resources/datasets.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | import hashlib 9 | from pathlib import Path 10 | 11 | from access.preprocess import get_parallel_file_pair_preprocessor 12 | from access.preprocessors import dump_preprocessors, load_preprocessors 13 | from access.resources.paths import PHASES, get_dataset_dir, get_data_filepath, get_filepaths_dict 14 | from access.utils.helpers import count_lines, read_lines, create_directory_or_skip 15 | 16 | 17 | def yield_indexes_of_lines(filepath, lines): 18 | lines = set(lines) 19 | with Path(filepath).open('r') as f: 20 | for idx, line in enumerate(f): 21 | if line.strip('\n') in lines: 22 | yield idx 23 | 24 | 25 | def sort_files_by_line_count(filepaths): 26 | return sorted(filepaths, key=lambda filepath: count_lines(filepath)) 27 | 28 | 29 | def has_lines_in_common(filepath1, filepath2): 30 | [smallest_filepath, largest_filepath] = sort_files_by_line_count([filepath1, filepath2]) 31 | for idx in yield_indexes_of_lines(largest_filepath, read_lines(smallest_filepath)): 32 | return True 33 | return False 34 | 35 | 36 | def get_preprocessed_dataset_name(dataset, preprocessor): 37 | return '_' + hashlib.md5((dataset + preprocessor.get_hash()).encode()).hexdigest() 38 | 39 | 40 | def create_preprocessed_dataset_one_preprocessor(dataset, preprocessor, n_jobs): 41 | new_dataset = get_preprocessed_dataset_name(dataset, preprocessor) 42 | with create_directory_or_skip(get_dataset_dir(new_dataset)): 43 | print(f'Creating preprocessed dataset with {preprocessor}: {dataset} -> {new_dataset}') 44 | new_dataset_dir = get_dataset_dir(new_dataset) 45 | filepaths_dict = get_filepaths_dict(dataset) 46 | new_filepaths_dict = get_filepaths_dict(new_dataset) 47 | for phase in PHASES: 48 | if not filepaths_dict[phase, 'complex'].exists() or not filepaths_dict[phase, 'complex'].exists(): 49 | continue 50 | parallel_file_pair_preprocessor = get_parallel_file_pair_preprocessor( 51 | preprocessor.encode_file_pair, 52 | n_jobs=n_jobs, 53 | ) 54 | parallel_file_pair_preprocessor(filepaths_dict[phase, 'complex'], filepaths_dict[phase, 'simple'], 55 | new_filepaths_dict[phase, 'complex'], new_filepaths_dict[phase, 'simple']) 56 | previous_preprocessors = load_preprocessors(get_dataset_dir(dataset)) 57 | if previous_preprocessors is not None: 58 | preprocessors = previous_preprocessors + [preprocessor] 59 | else: 60 | preprocessors = [preprocessor] 61 | dump_preprocessors(preprocessors, new_dataset_dir) 62 | with open(new_dataset_dir / 'original_dataset', 'w') as f: 63 | f.write(dataset + '\n') 64 | 65 | return new_dataset 66 | 67 | 68 | def create_preprocessed_dataset(dataset, preprocessors, n_jobs=1): 69 | for preprocessor in preprocessors: 70 | # Fit preprocessor on input dataset 71 | preprocessor.fit(get_data_filepath(dataset, 'train', 'complex'), get_data_filepath(dataset, 'train', 'simple')) 72 | dataset = create_preprocessed_dataset_one_preprocessor(dataset, preprocessor, n_jobs) 73 | return dataset 74 | -------------------------------------------------------------------------------- /access/resources/paths.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from itertools import product 9 | from pathlib import Path 10 | 11 | REPO_DIR = Path(__file__).resolve().parent.parent.parent 12 | EXP_DIR = REPO_DIR / 'experiments' 13 | RESOURCES_DIR = REPO_DIR / 'resources' 14 | DATASETS_DIR = RESOURCES_DIR / 'datasets' 15 | VARIOUS_DIR = RESOURCES_DIR / 'various' 16 | FASTTEXT_EMBEDDINGS_PATH = VARIOUS_DIR / 'fasttext-vectors/wiki.en.vec' 17 | MODELS_DIR = RESOURCES_DIR / 'models' 18 | BEST_MODEL_DIR = MODELS_DIR / 'best_model' 19 | 20 | LANGUAGES = ['complex', 'simple'] 21 | PHASES = ['train', 'valid', 'test'] 22 | 23 | 24 | def get_dataset_dir(dataset): 25 | return DATASETS_DIR / dataset 26 | 27 | 28 | def get_data_filepath(dataset, phase, language, i=None): 29 | suffix = '' # Create suffix e.g. for multiple references 30 | if i is not None: 31 | suffix = f'.{i}' 32 | filename = f'{dataset}.{phase}.{language}{suffix}' 33 | return get_dataset_dir(dataset) / filename 34 | 35 | 36 | def get_filepaths_dict(dataset): 37 | return {(phase, language): get_data_filepath(dataset, phase, language) 38 | for phase, language in product(PHASES, LANGUAGES)} 39 | -------------------------------------------------------------------------------- /access/resources/prepare.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from glob import glob 9 | import os 10 | from pathlib import Path 11 | import shutil 12 | import tempfile 13 | 14 | import numpy as np 15 | 16 | from access.text import word_tokenize 17 | from access.utils.helpers import (yield_lines_in_parallel, write_lines_in_parallel, create_directory_or_skip, 18 | lock_directory) 19 | from access.preprocess import replace_lrb_rrb, replace_lrb_rrb_file, normalize_quotes 20 | from access.resources.utils import download_and_extract, add_newline_at_end_of_file, git_clone 21 | from access.resources.paths import (FASTTEXT_EMBEDDINGS_PATH, get_dataset_dir, get_data_filepath, PHASES, MODELS_DIR, 22 | BEST_MODEL_DIR) 23 | 24 | 25 | def prepare_wikilarge(): 26 | dataset = 'wikilarge' 27 | with create_directory_or_skip(get_dataset_dir(dataset)): 28 | url = 'https://github.com/louismartin/dress-data/raw/master/data-simplification.tar.bz2' 29 | extracted_path = download_and_extract(url)[0] 30 | # Only rename files and put them in local directory architecture 31 | for phase in PHASES: 32 | for (old_language_name, new_language_name) in [('src', 'complex'), ('dst', 'simple')]: 33 | old_path_glob = os.path.join(extracted_path, dataset, f'*.ori.{phase}.{old_language_name}') 34 | globs = glob(old_path_glob) 35 | assert len(globs) == 1 36 | old_path = globs[0] 37 | new_path = get_data_filepath(dataset, phase, new_language_name) 38 | shutil.copyfile(old_path, new_path) 39 | shutil.move(replace_lrb_rrb_file(new_path), new_path) 40 | add_newline_at_end_of_file(new_path) 41 | return dataset 42 | 43 | 44 | def prepare_turkcorpus_lower(): 45 | dataset = 'turkcorpus_lower' 46 | with create_directory_or_skip(get_dataset_dir(dataset)): 47 | url = 'https://github.com/cocoxu/simplification.git' 48 | output_dir = Path(tempfile.mkdtemp()) 49 | git_clone(url, output_dir) 50 | print(output_dir) 51 | print('Processing...') 52 | # Only rename files and put them in local directory architecture 53 | turkcorpus_lower_dir = output_dir / 'data/turkcorpus' 54 | print(turkcorpus_lower_dir) 55 | for (old_phase, new_phase) in [('test', 'test'), ('tune', 'valid')]: 56 | for (old_language_name, new_language_name) in [('norm', 'complex'), ('simp', 'simple')]: 57 | old_path = turkcorpus_lower_dir / f'{old_phase}.8turkers.tok.{old_language_name}' 58 | new_path = get_data_filepath('turkcorpus_lower', new_phase, new_language_name) 59 | shutil.copyfile(old_path, new_path) 60 | add_newline_at_end_of_file(new_path) 61 | shutil.move(replace_lrb_rrb_file(new_path), new_path) 62 | for i in range(8): 63 | old_path = turkcorpus_lower_dir / f'{old_phase}.8turkers.tok.turk.{i}' 64 | new_path = get_data_filepath('turkcorpus_lower', new_phase, 'simple.turk', i=i) 65 | shutil.copyfile(old_path, new_path) 66 | add_newline_at_end_of_file(new_path) 67 | shutil.move(replace_lrb_rrb_file(new_path), new_path) 68 | print('Done.') 69 | return dataset 70 | 71 | 72 | def prepare_turkcorpus(): 73 | dataset = 'turkcorpus' 74 | with create_directory_or_skip(get_dataset_dir(dataset)): 75 | # Import here to avoid circular imports 76 | from access.feature_extraction import get_levenshtein_similarity 77 | prepare_turkcorpus_lower() 78 | url = 'https://github.com/cocoxu/simplification.git' 79 | output_dir = Path(tempfile.mkdtemp()) 80 | git_clone(url, output_dir) 81 | print('Processing...') 82 | # Only rename files and put them in local directory architecture 83 | turkcorpus_truecased_dir = output_dir / 'data/turkcorpus/truecased' 84 | for (old_phase, new_phase) in [('test', 'test'), ('tune', 'valid')]: 85 | # (1) read the .tsv for which each line is tab separated: 86 | # `idx, complex_sentence, *turk_sentences = line.split('\t')` 87 | # (2) replace lrb and rrb, tokenize 88 | # (3) Turk sentences are shuffled for each sample so need to realign them with turkcorpus lower 89 | tsv_filepath = turkcorpus_truecased_dir / f'{old_phase}.8turkers.organized.tsv' 90 | output_complex_filepath = get_data_filepath(dataset, new_phase, 'complex') 91 | output_ref_filepaths = [get_data_filepath(dataset, new_phase, 'simple.turk', i) for i in range(8)] 92 | # These files will be used to reorder the shuffled ref sentences 93 | ordered_ref_filepaths = [ 94 | get_data_filepath('turkcorpus_lower', new_phase, 'simple.turk', i) for i in range(8) 95 | ] 96 | with write_lines_in_parallel([output_complex_filepath] + output_ref_filepaths) as files: 97 | input_filepaths = [tsv_filepath] + ordered_ref_filepaths 98 | for tsv_line, *ordered_ref_sentences in yield_lines_in_parallel(input_filepaths): 99 | sample_id, complex_sentence, *shuffled_ref_sentences = [ 100 | word_tokenize(normalize_quotes(replace_lrb_rrb(s))) for s in tsv_line.split('\t') 101 | ] 102 | reordered_sentences = [] 103 | for ordered_ref_sentence in ordered_ref_sentences: 104 | # Find the position of the ref_sentence in the shuffled sentences 105 | similarities = [ 106 | get_levenshtein_similarity(ordered_ref_sentence.replace(' ', ''), 107 | shuffled_ref_sentence.lower().replace(' ', '')) 108 | for shuffled_ref_sentence in shuffled_ref_sentences 109 | ] 110 | idx = np.argmax(similarities) 111 | # A few sentences have differing punctuation marks 112 | assert similarities[idx] > 0.98, \ 113 | f'{ordered_ref_sentence} != {shuffled_ref_sentences[idx].lower()} {similarities[idx]:.2f}' 114 | reordered_sentences.append(shuffled_ref_sentences.pop(idx)) 115 | assert len(shuffled_ref_sentences) == 0 116 | assert len(reordered_sentences) == 8 117 | files.write([complex_sentence] + reordered_sentences) 118 | return dataset 119 | 120 | 121 | def prepare_fasttext_embeddings(): 122 | FASTTEXT_EMBEDDINGS_PATH.parent.mkdir(parents=True, exist_ok=True) 123 | with lock_directory(FASTTEXT_EMBEDDINGS_PATH.parent): 124 | if FASTTEXT_EMBEDDINGS_PATH.exists(): 125 | return 126 | url = 'https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.en.300.vec.gz' 127 | extracted_path = download_and_extract(url)[0] 128 | shutil.move(extracted_path, FASTTEXT_EMBEDDINGS_PATH) 129 | 130 | 131 | def prepare_models(): 132 | MODELS_DIR.mkdir(parents=True, exist_ok=True) 133 | if not BEST_MODEL_DIR.exists(): 134 | url = 'http://dl.fbaipublicfiles.com/access/best_model.tar.gz' 135 | extracted_path = download_and_extract(url)[0] 136 | shutil.move(extracted_path, BEST_MODEL_DIR) 137 | all_parameters_model_dir = MODELS_DIR / 'all_parameters_model' 138 | if not all_parameters_model_dir.exists(): 139 | url = 'http://dl.fbaipublicfiles.com/access/all_parameters_model.tar.gz' 140 | extracted_path = download_and_extract(url)[0] 141 | shutil.move(extracted_path, all_parameters_model_dir) 142 | return BEST_MODEL_DIR 143 | -------------------------------------------------------------------------------- /access/resources/utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | import bz2 9 | import gzip 10 | import os 11 | from pathlib import Path 12 | import shutil 13 | import sys 14 | import tarfile 15 | import tempfile 16 | import time 17 | from urllib.request import urlretrieve 18 | import zipfile 19 | 20 | import git 21 | from tqdm import tqdm 22 | 23 | 24 | def reporthook(count, block_size, total_size): 25 | # Download progress bar 26 | global start_time 27 | if count == 0: 28 | start_time = time.time() 29 | return 30 | duration = time.time() - start_time 31 | progress_size_mb = count * block_size / (1024 * 1024) 32 | speed = progress_size_mb / duration 33 | percent = int(count * block_size * 100 / total_size) 34 | msg = f'\r... {percent}% - {int(progress_size_mb)} MB - {speed:.2f} MB/s - {int(duration)}s' 35 | sys.stdout.write(msg) 36 | 37 | 38 | def download(url, destination_path): 39 | print('Downloading...') 40 | try: 41 | urlretrieve(url, destination_path, reporthook) 42 | sys.stdout.write('\n') 43 | except (Exception, KeyboardInterrupt, SystemExit): 44 | print('Rolling back: remove partially downloaded file') 45 | os.remove(destination_path) 46 | raise 47 | 48 | 49 | def download_and_extract(url): 50 | tmp_dir = Path(tempfile.mkdtemp()) 51 | compressed_filename = url.split('/')[-1] 52 | compressed_filepath = tmp_dir / compressed_filename 53 | download(url, compressed_filepath) 54 | print('Extracting...') 55 | return extract(compressed_filepath, tmp_dir) 56 | 57 | 58 | def extract(filepath, output_dir): 59 | # Infer extract method based on extension 60 | extensions_to_methods = { 61 | '.tar.gz': untar, 62 | '.tar.bz2': untar, 63 | '.tgz': untar, 64 | '.zip': unzip, 65 | '.gz': ungzip, 66 | '.bz2': unbz2, 67 | } 68 | 69 | def get_extension(filename, extensions): 70 | possible_extensions = [ext for ext in extensions if filename.endswith(ext)] 71 | if len(possible_extensions) == 0: 72 | raise Exception(f'File {filename} has an unknown extension') 73 | # Take the longest (.tar.gz should take precedence over .gz) 74 | return max(possible_extensions, key=lambda ext: len(ext)) 75 | 76 | filename = os.path.basename(filepath) 77 | extension = get_extension(filename, list(extensions_to_methods)) 78 | extract_method = extensions_to_methods[extension] 79 | 80 | # Extract files in a temporary dir then move the extracted item back to 81 | # the ouput dir in order to get the details of what was extracted 82 | tmp_extract_dir = tempfile.mkdtemp() 83 | # Extract 84 | extract_method(filepath, output_dir=tmp_extract_dir) 85 | extracted_items = os.listdir(tmp_extract_dir) 86 | output_paths = [] 87 | for name in extracted_items: 88 | extracted_path = os.path.join(tmp_extract_dir, name) 89 | output_path = os.path.join(output_dir, name) 90 | move_with_overwrite(extracted_path, output_path) 91 | output_paths.append(output_path) 92 | return output_paths 93 | 94 | 95 | def move_with_overwrite(source_path, target_path): 96 | if os.path.isfile(target_path): 97 | os.remove(target_path) 98 | if os.path.isdir(target_path) and os.path.isdir(source_path): 99 | shutil.rmtree(target_path) 100 | shutil.move(source_path, target_path) 101 | 102 | 103 | def untar(compressed_path, output_dir): 104 | with tarfile.open(compressed_path) as f: 105 | f.extractall(output_dir) 106 | 107 | 108 | def unzip(compressed_path, output_dir): 109 | with zipfile.ZipFile(compressed_path, 'r') as f: 110 | f.extractall(output_dir) 111 | 112 | 113 | def ungzip(compressed_path, output_dir): 114 | filename = os.path.basename(compressed_path) 115 | assert filename.endswith('.gz') 116 | if not os.path.exists(output_dir): 117 | os.makedirs(output_dir) 118 | output_path = os.path.join(output_dir, filename[:-3]) 119 | with gzip.open(compressed_path, 'rb') as f_in: 120 | with open(output_path, 'wb') as f_out: 121 | shutil.copyfileobj(f_in, f_out) 122 | 123 | 124 | def unbz2(compressed_path, output_dir): 125 | extract_filename = os.path.basename(compressed_path).replace('.bz2', '') 126 | extract_path = os.path.join(output_dir, extract_filename) 127 | with bz2.BZ2File(compressed_path, 'rb') as compressed_file, open(extract_path, 'wb') as extract_file: 128 | for data in tqdm(iter(lambda: compressed_file.read(1024 * 1024), b'')): 129 | extract_file.write(data) 130 | 131 | 132 | def add_newline_at_end_of_file(file_path): 133 | with open(file_path, 'r') as f: 134 | last_character = f.readlines()[-1][-1] 135 | if last_character == '\n': 136 | return 137 | print(f'Adding newline at the end of {file_path}') 138 | with open(file_path, 'a') as f: 139 | f.write('\n') 140 | 141 | 142 | def git_clone(url, output_dir, overwrite=True): 143 | if Path(output_dir).exists(): 144 | shutil.rmtree(output_dir) 145 | git.Repo.clone_from(url, output_dir) 146 | 147 | 148 | def replace_lrb_rrb_file(filepath): 149 | tmp_filepath = filepath + '.tmp' 150 | with open(filepath, 'r') as input_file, open(tmp_filepath, 'w') as output_file: 151 | for line in input_file: 152 | output_file.write(line.replace('-lrb-', '(').replace('-rrb-', ')')) 153 | os.rename(tmp_filepath, filepath) 154 | -------------------------------------------------------------------------------- /access/simplifiers.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from functools import wraps 9 | from pathlib import Path 10 | import shutil 11 | import tempfile 12 | 13 | from imohash import hashfile 14 | 15 | from access.fairseq.base import fairseq_generate 16 | from access.preprocessors import ComposedPreprocessor, load_preprocessors 17 | from access.utils.helpers import count_lines 18 | 19 | 20 | def memoize_simplifier(simplifier): 21 | memo = {} 22 | 23 | @wraps(simplifier) 24 | def wrapped(complex_filepath, pred_filepath): 25 | complex_filehash = hashfile(complex_filepath, hexdigest=True) 26 | previous_pred_filepath = memo.get(complex_filehash) 27 | if previous_pred_filepath is not None and Path(previous_pred_filepath).exists(): 28 | assert count_lines(complex_filepath) == count_lines(previous_pred_filepath) 29 | # Reuse previous prediction 30 | shutil.copyfile(previous_pred_filepath, pred_filepath) 31 | else: 32 | simplifier(complex_filepath, pred_filepath) 33 | # Save prediction 34 | memo[complex_filehash] = pred_filepath 35 | 36 | return wrapped 37 | 38 | 39 | def get_fairseq_simplifier(exp_dir, reload_preprocessors=False, **kwargs): 40 | '''Method factory''' 41 | @memoize_simplifier 42 | def fairseq_simplifier(complex_filepath, output_pred_filepath): 43 | # Trailing spaces for markdown formatting 44 | print('simplifier_type="fairseq_simplifier" ') 45 | print(f'exp_dir="{exp_dir}" ') 46 | fairseq_generate(complex_filepath, output_pred_filepath, exp_dir, **kwargs) 47 | 48 | preprocessors = None 49 | if reload_preprocessors: 50 | preprocessors = load_preprocessors(exp_dir) 51 | if preprocessors is not None: 52 | fairseq_simplifier = get_preprocessed_simplifier(fairseq_simplifier, preprocessors) 53 | return fairseq_simplifier 54 | 55 | 56 | def get_preprocessed_simplifier(simplifier, preprocessors): 57 | composed_preprocessor = ComposedPreprocessor(preprocessors) 58 | 59 | @memoize_simplifier 60 | @wraps(simplifier) 61 | def preprocessed_simplifier(complex_filepath, output_pred_filepath): 62 | print(f'preprocessors={preprocessors}') 63 | preprocessed_complex_filepath = tempfile.mkstemp()[1] 64 | composed_preprocessor.encode_file(complex_filepath, preprocessed_complex_filepath) 65 | preprocessed_output_pred_filepath = tempfile.mkstemp()[1] 66 | simplifier(preprocessed_complex_filepath, preprocessed_output_pred_filepath) 67 | composed_preprocessor.decode_file(preprocessed_output_pred_filepath, 68 | output_pred_filepath, 69 | encoder_filepath=complex_filepath) 70 | 71 | preprocessed_simplifier.__name__ = f'{preprocessed_simplifier.__name__}_{composed_preprocessor.get_suffix()}' 72 | return preprocessed_simplifier 73 | -------------------------------------------------------------------------------- /access/text.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from functools import lru_cache 9 | import re 10 | from string import punctuation 11 | 12 | from nltk.tokenize.nist import NISTTokenizer 13 | from nltk.corpus import stopwords as nltk_stopwords 14 | import spacy 15 | 16 | # TODO: #language_specific 17 | stopwords = set(nltk_stopwords.words('english')) 18 | 19 | 20 | @lru_cache(maxsize=100) # To speed up subsequent calls 21 | def word_tokenize(sentence): 22 | tokenizer = NISTTokenizer() 23 | sentence = ' '.join(tokenizer.tokenize(sentence)) 24 | # Rejoin special tokens that where tokenized by error: e.g. "" -> "< PERSON _ 1 >" 25 | for match in re.finditer(r'< (?:[A-Z]+ _ )+\d+ >', sentence): 26 | sentence = sentence.replace(match.group(), ''.join(match.group().split())) 27 | return sentence 28 | 29 | 30 | def to_words(sentence): 31 | return sentence.split() 32 | 33 | 34 | def remove_punctuation_characters(text): 35 | return ''.join([char for char in text if char not in punctuation]) 36 | 37 | 38 | @lru_cache(maxsize=1000) 39 | def is_punctuation(word): 40 | return remove_punctuation_characters(word) == '' 41 | 42 | 43 | @lru_cache(maxsize=100) 44 | def remove_punctuation_tokens(text): 45 | return ' '.join([w for w in to_words(text) if not is_punctuation(w)]) 46 | 47 | 48 | def remove_stopwords(text): 49 | return ' '.join([w for w in to_words(text) if w.lower() not in stopwords]) 50 | 51 | 52 | @lru_cache(maxsize=1) 53 | def get_spacy_model(): 54 | model = 'en_core_web_sm' 55 | if not spacy.util.is_package(model): 56 | spacy.cli.download(model) 57 | spacy.cli.link(model, model, force=True, model_path=spacy.util.get_package_path(model)) 58 | return spacy.load(model) # python -m spacy download en_core_web_sm` 59 | 60 | 61 | @lru_cache(maxsize=10**6) 62 | def spacy_process(text): 63 | return get_spacy_model()(str(text)) 64 | -------------------------------------------------------------------------------- /access/utils/helpers.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from contextlib import contextmanager, AbstractContextManager 9 | from fcntl import flock, LOCK_EX, LOCK_UN 10 | import inspect 11 | import io 12 | from itertools import zip_longest 13 | from pathlib import Path 14 | import shutil 15 | import sys 16 | import tempfile 17 | 18 | import numpy as np 19 | 20 | 21 | @contextmanager 22 | def open_files(filepaths, mode='r'): 23 | files = [] 24 | try: 25 | files = [Path(filepath).open(mode) for filepath in filepaths] 26 | yield files 27 | finally: 28 | [f.close() for f in files] 29 | 30 | 31 | def yield_lines_in_parallel(filepaths, strip=True, strict=True, n_lines=float('inf')): 32 | assert type(filepaths) == list 33 | with open_files(filepaths) as files: 34 | for i, parallel_lines in enumerate(zip_longest(*files)): 35 | if i >= n_lines: 36 | break 37 | if None in parallel_lines: 38 | assert not strict, f'Files don\'t have the same number of lines: {filepaths}, use strict=False' 39 | if strip: 40 | parallel_lines = [l.rstrip('\n') if l is not None else None for l in parallel_lines] 41 | yield parallel_lines 42 | 43 | 44 | class FilesWrapper: 45 | '''Write to multiple open files at the same time''' 46 | def __init__(self, files, strict=True): 47 | self.files = files 48 | self.strict = strict # Whether to raise an exception when a line is None 49 | 50 | def write(self, lines): 51 | assert len(lines) == len(self.files) 52 | for line, f in zip(lines, self.files): 53 | if line is None: 54 | assert not self.strict 55 | continue 56 | f.write(line.rstrip('\n') + '\n') 57 | 58 | 59 | @contextmanager 60 | def write_lines_in_parallel(filepaths, strict=True): 61 | with open_files(filepaths, 'w') as files: 62 | yield FilesWrapper(files, strict=strict) 63 | 64 | 65 | def write_lines(lines, filepath): 66 | filepath = Path(filepath) 67 | filepath.parent.mkdir(parents=True, exist_ok=True) 68 | with filepath.open('w') as f: 69 | for line in lines: 70 | f.write(line + '\n') 71 | 72 | 73 | def yield_lines(filepath, n_lines=float('inf'), prop=1): 74 | if prop < 1: 75 | assert n_lines == float('inf') 76 | n_lines = int(prop * count_lines(filepath)) 77 | with open(filepath, 'r') as f: 78 | for i, l in enumerate(f): 79 | if i >= n_lines: 80 | break 81 | yield l.rstrip('\n') 82 | 83 | 84 | def read_lines(filepath, n_lines=float('inf'), prop=1): 85 | return list(yield_lines(filepath, n_lines, prop)) 86 | 87 | 88 | def count_lines(filepath): 89 | n_lines = 0 90 | with Path(filepath).open() as f: 91 | for l in f: 92 | n_lines += 1 93 | return n_lines 94 | 95 | 96 | @contextmanager 97 | def open_with_lock(filepath, mode): 98 | with open(filepath, mode) as f: 99 | flock(f, LOCK_EX) 100 | yield f 101 | flock(f, LOCK_UN) 102 | 103 | 104 | def get_lockfile_path(path): 105 | path = Path(path) 106 | if path.is_dir(): 107 | return path / '.lockfile' 108 | if path.is_file(): 109 | return path.parent / f'.{path.name}.lockfile' 110 | 111 | 112 | @contextmanager 113 | def lock_directory(dir_path): 114 | # TODO: Locking a directory should lock all files in that directory 115 | # Right now if we lock foo/, someone else can lock foo/bar.txt 116 | # TODO: Nested with lock_directory() should not be blocking 117 | assert Path(dir_path).exists(), f'Directory does not exists: {dir_path}' 118 | lockfile_path = get_lockfile_path(dir_path) 119 | with open_with_lock(lockfile_path, 'w'): 120 | yield 121 | 122 | 123 | def safe_division(a, b): 124 | if b == 0: 125 | return 0 126 | return a / b 127 | 128 | 129 | def harmonic_mean(values, coefs=None): 130 | if 0 in values: 131 | return 0 132 | values = np.array(values) 133 | if coefs is None: 134 | coefs = np.ones(values.shape) 135 | values = np.array(values) 136 | coefs = np.array(coefs) 137 | return np.sum(coefs) / np.dot(coefs, 1 / values) 138 | 139 | 140 | @contextmanager 141 | def mute(mute_stdout=True, mute_stderr=True): 142 | save_stdout = sys.stdout 143 | save_stderr = sys.stderr 144 | if mute_stdout: 145 | sys.stdout = io.StringIO() 146 | if mute_stderr: 147 | sys.stderr = io.StringIO() 148 | try: 149 | yield 150 | finally: 151 | sys.stdout = save_stdout 152 | sys.stderr = save_stderr 153 | 154 | 155 | @contextmanager 156 | def log_stdout(filepath, mute_stdout=False): 157 | '''Context manager to write both to stdout and to a file''' 158 | class MultipleStreamsWriter: 159 | def __init__(self, streams): 160 | self.streams = streams 161 | 162 | def write(self, message): 163 | for stream in self.streams: 164 | stream.write(message) 165 | 166 | def flush(self): 167 | for stream in self.streams: 168 | stream.flush() 169 | 170 | save_stdout = sys.stdout 171 | log_file = open(filepath, 'w') 172 | if mute_stdout: 173 | sys.stdout = MultipleStreamsWriter([log_file]) # Write to file only 174 | else: 175 | sys.stdout = MultipleStreamsWriter([save_stdout, log_file]) # Write to both stdout and file 176 | try: 177 | yield 178 | finally: 179 | sys.stdout = save_stdout 180 | log_file.close() 181 | 182 | 183 | def add_dicts(*dicts): 184 | return {k: v for dic in dicts for k, v in dic.items()} 185 | 186 | 187 | def get_default_args(func): 188 | signature = inspect.signature(func) 189 | return {k: v.default for k, v in signature.parameters.items() if v.default is not inspect.Parameter.empty} 190 | 191 | 192 | def get_allowed_kwargs(func, *args, **kwargs): 193 | expected_args = inspect.getargspec(func).args 194 | allowed_kwargs = expected_args[len(args):] 195 | return {k: v for k, v in kwargs.items() if k in allowed_kwargs} 196 | 197 | 198 | class SkipWithBlock(Exception): 199 | pass 200 | 201 | 202 | class create_directory_or_skip(AbstractContextManager): 203 | '''Context manager for creating a new directory (with rollback and skipping with block if exists) 204 | 205 | In order to skip the execution of the with block if the dataset already exists, this context manager uses deep 206 | magic from https://stackoverflow.com/questions/12594148/skipping-execution-of-with-block 207 | ''' 208 | def __init__(self, dir_path, overwrite=False): 209 | self.dir_path = Path(dir_path) 210 | self.overwrite = overwrite 211 | 212 | def __enter__(self): 213 | if self.dir_path.exists(): 214 | self.directory_lock = lock_directory(self.dir_path) 215 | self.directory_lock.__enter__() 216 | files_in_directory = list(self.dir_path.iterdir()) 217 | if set(files_in_directory) in [set([]), set([self.dir_path / '.lockfile'])]: 218 | # TODO: Quick hack to remove empty directories 219 | self.directory_lock.__exit__(None, None, None) 220 | print(f'Removing empty directory {self.dir_path}') 221 | shutil.rmtree(self.dir_path) 222 | else: 223 | # Deep magic hack to skip the execution of the code inside the with block 224 | # We set the trace to a dummy function 225 | sys.settrace(lambda *args, **keys: None) 226 | # Get the calling frame (sys._getframe(0) is the current frame) 227 | frame = sys._getframe(1) 228 | # Set the calling frame's trace to the one that raises the special exception 229 | frame.f_trace = self.trace 230 | return 231 | print(f'Creating {self.dir_path}...') 232 | self.dir_path.mkdir(parents=True, exist_ok=True) 233 | self.directory_lock = lock_directory(self.dir_path) 234 | self.directory_lock.__enter__() 235 | 236 | def trace(self, frame, event, arg): 237 | # This method is called when a new local scope is entered, i.e. right when the code in the with block begins 238 | # The exception will therefore be caught by the __exit__() 239 | raise SkipWithBlock() 240 | 241 | def __exit__(self, type, value, traceback): 242 | self.directory_lock.__exit__(type, value, traceback) 243 | if type is not None: 244 | if issubclass(type, SkipWithBlock): 245 | return True # Suppress special SkipWithBlock exception 246 | if issubclass(type, BaseException): 247 | # Rollback 248 | print(f'Error: Rolling back creation of directory {self.dir_path}') 249 | shutil.rmtree(self.dir_path) 250 | return False # Reraise the exception 251 | 252 | 253 | def get_temp_filepath(create=False): 254 | temp_filepath = Path(tempfile.mkstemp()[1]) 255 | if not create: 256 | temp_filepath.unlink() 257 | return temp_filepath 258 | 259 | 260 | def get_temp_filepaths(n_filepaths, create=False): 261 | return [get_temp_filepath(create=create) for _ in range(n_filepaths)] 262 | 263 | 264 | def delete_files(filepaths): 265 | for filepath in filepaths: 266 | filepath = Path(filepath) 267 | assert filepath.is_file() 268 | filepath.unlink() 269 | -------------------------------------------------------------------------------- /access/utils/training.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | # TODO: Move to utils/training.py 9 | from functools import wraps 10 | import time 11 | 12 | 13 | def print_method_name(func): 14 | '''Decorator to print method name for logging purposes''' 15 | @wraps(func) # To preserve the name and path for pickling purposes 16 | def wrapped_func(*args, **kwargs): 17 | print(f"method_name='{func.__name__}'") 18 | return func(*args, **kwargs) 19 | 20 | return wrapped_func 21 | 22 | 23 | def print_args(func): 24 | '''Decorator to print arguments of method for logging purposes''' 25 | @wraps(func) # To preserve the name and path for pickling purposes 26 | def wrapped_func(*args, **kwargs): 27 | print(f'args={args}') 28 | print(f'kwargs={kwargs}') 29 | return func(*args, **kwargs) 30 | 31 | return wrapped_func 32 | 33 | 34 | def print_result(func): 35 | '''Decorator to print result of method for logging purposes''' 36 | @wraps(func) # To preserve the name and path for pickling purposes 37 | def wrapped_func(*args, **kwargs): 38 | result = func(*args, **kwargs) 39 | print(f'result={result}') 40 | return result 41 | 42 | return wrapped_func 43 | 44 | 45 | def print_running_time(func): 46 | '''Decorator to print running time of method for logging purposes''' 47 | @wraps(func) # To preserve the name and path for pickling purposes 48 | def wrapped_func(*args, **kwargs): 49 | start_time = time.time() 50 | result = func(*args, **kwargs) 51 | print(f'running_time={time.time() - start_time}') 52 | return result 53 | 54 | return wrapped_func 55 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | python_Levenshtein==0.12.0 2 | dill==0.3.0 3 | GitPython==3.1.0 4 | imohash==1.0.4 5 | joblib==0.13.2 6 | nevergrad==0.2.3 7 | nltk 8 | numpy==1.22 9 | pandas==0.25.1 10 | sentencepiece==0.1.86 11 | spacy==2.1.3 12 | tabulate==0.8.4 13 | torch==1.4.0 14 | tqdm==4.36.1 15 | easse@git+git://github.com/feralvam/easse.git@580bba7e1378fc8289c663f864e0487188fe8067 16 | fairseq@git+https://github.com/louismartin/fairseq.git@controllable-sentence-simplification 17 | -------------------------------------------------------------------------------- /resources/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/various/sentencepiece_model/sentencepiece_model_10000.model: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookresearch/access/f514bfd51df96cce99b695f1e5b7da552140a993/resources/various/sentencepiece_model/sentencepiece_model_10000.model -------------------------------------------------------------------------------- /scripts/evaluate.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from access.evaluation.general import evaluate_simplifier_on_turkcorpus 9 | from access.preprocessors import get_preprocessors 10 | from access.resources.prepare import prepare_turkcorpus, prepare_models 11 | from access.simplifiers import get_fairseq_simplifier, get_preprocessed_simplifier 12 | 13 | 14 | if __name__ == '__main__': 15 | print('Evaluating pretrained model') 16 | prepare_turkcorpus() 17 | best_model_dir = prepare_models() 18 | recommended_preprocessors_kwargs = { 19 | 'LengthRatioPreprocessor': {'target_ratio': 0.95}, 20 | 'LevenshteinPreprocessor': {'target_ratio': 0.75}, 21 | 'WordRankRatioPreprocessor': {'target_ratio': 0.75}, 22 | 'SentencePiecePreprocessor': {'vocab_size': 10000}, 23 | } 24 | preprocessors = get_preprocessors(recommended_preprocessors_kwargs) 25 | simplifier = get_fairseq_simplifier(best_model_dir, beam=8) 26 | simplifier = get_preprocessed_simplifier(simplifier, preprocessors=preprocessors) 27 | print(evaluate_simplifier_on_turkcorpus(simplifier, phase='test')) 28 | -------------------------------------------------------------------------------- /scripts/generate.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | import fileinput 9 | 10 | from access.preprocessors import get_preprocessors 11 | from access.resources.prepare import prepare_models 12 | from access.simplifiers import get_fairseq_simplifier, get_preprocessed_simplifier 13 | from access.text import word_tokenize 14 | from access.utils.helpers import yield_lines, write_lines, get_temp_filepath, mute 15 | 16 | 17 | if __name__ == '__main__': 18 | # Usage: python generate.py < my_file.complex 19 | # Read from stdin 20 | source_filepath = get_temp_filepath() 21 | write_lines([word_tokenize(line) for line in fileinput.input()], source_filepath) 22 | # Load best model 23 | best_model_dir = prepare_models() 24 | recommended_preprocessors_kwargs = { 25 | 'LengthRatioPreprocessor': {'target_ratio': 0.95}, 26 | 'LevenshteinPreprocessor': {'target_ratio': 0.75}, 27 | 'WordRankRatioPreprocessor': {'target_ratio': 0.75}, 28 | 'SentencePiecePreprocessor': {'vocab_size': 10000}, 29 | } 30 | preprocessors = get_preprocessors(recommended_preprocessors_kwargs) 31 | simplifier = get_fairseq_simplifier(best_model_dir, beam=8) 32 | simplifier = get_preprocessed_simplifier(simplifier, preprocessors=preprocessors) 33 | # Simplify 34 | pred_filepath = get_temp_filepath() 35 | with mute(): 36 | simplifier(source_filepath, pred_filepath) 37 | for line in yield_lines(pred_filepath): 38 | print(line) 39 | -------------------------------------------------------------------------------- /scripts/train.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from access.fairseq.main import fairseq_train_and_evaluate 9 | from access.resources.prepare import prepare_wikilarge, prepare_turkcorpus 10 | 11 | 12 | if __name__ == '__main__': 13 | print('Training a model from scratch') 14 | prepare_wikilarge() 15 | prepare_turkcorpus() 16 | kwargs = { 17 | 'arch': 'transformer', 18 | 'warmup_updates': 4000, 19 | 'parametrization_budget': 256, 20 | 'beam': 8, 21 | 'dataset': 'wikilarge', 22 | 'dropout': 0.2, 23 | 'fp16': False, 24 | 'label_smoothing': 0.54, 25 | 'lr': 0.00011, 26 | 'lr_scheduler': 'fixed', 27 | 'max_epoch': 100, 28 | 'max_tokens': 5000, 29 | 'metrics_coefs': [0, 1, 0], 30 | 'optimizer': 'adam', 31 | 'preprocessors_kwargs': { 32 | 'LengthRatioPreprocessor': { 33 | 'target_ratio': 0.8 # Default initial value 34 | }, 35 | 'LevenshteinPreprocessor': { 36 | 'target_ratio': 0.8 # Default initial value 37 | }, 38 | 'WordRankRatioPreprocessor': { 39 | 'target_ratio': 0.8 # Default initial value 40 | }, 41 | 'DependencyTreeDepthRatioPreprocessor': { 42 | 'target_ratio': 0.8 # Default initial value 43 | }, 44 | 'SentencePiecePreprocessor': { 45 | 'vocab_size': 10000 46 | } 47 | } 48 | } 49 | fairseq_train_and_evaluate(**kwargs) 50 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [pep8] 2 | max-line-length = 120 3 | 4 | [yapf] 5 | based_on_style = pep8 6 | column_limit = 120 7 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | # 7 | 8 | from setuptools import setup, find_packages 9 | 10 | 11 | with open('README.md', 'r') as f: 12 | long_description = f.read() 13 | 14 | with open('requirements.txt', 'r') as f: 15 | requirements = [line.strip() for line in f] 16 | 17 | setup( 18 | name='access', 19 | version='0.2', 20 | description='Controllable Sentence Simplification', 21 | long_description=long_description, 22 | long_description_content_type='text/markdown', 23 | author='Louis Martin ', 24 | url='https://github.com/facebookreasearch/access', 25 | packages=find_packages(exclude=['resources']), 26 | install_requires=requirements, 27 | ) 28 | -------------------------------------------------------------------------------- /system_output/README.md: -------------------------------------------------------------------------------- 1 | # System outputs 2 | Outputs of our best model on [TurkCorpus](https://github.com/cocoxu/simplification/tree/master/data/turkcorpus) valid and test sets. 3 | 4 | Untokenized and truecased version of our outputs can be found in [EASSE](https://github.com/feralvam/easse/blob/master/easse/resources/data/system_outputs/turkcorpus/test/ACCESS). 5 | -------------------------------------------------------------------------------- /system_output/other_formats/test.pred.raw: -------------------------------------------------------------------------------- 1 | One side of the armed conflict is made up of the Sudanese military and the Janjaweed, a Sudanese militia group brought mostly from the Afro-Arab Abbala tribes of the northern Rizeigat region in Sudan. 2 | Jeddah is the main gateway to Mecca, Islam's holiest city. They can be able to visit at least once in their lifetime. 3 | The Great Dark Spot is thought to be a hole in the cloud deck of Neptune. 4 | His next work, Saturday, is an eventful day in the life of a very successful neurosurgeon. 5 | The tarantula, the trickster character, spun a black cord and, attaching it to the ball, pulled away fast to the east, pulling on the cord with all his strength. 6 | There he died six weeks later on January 13, 888. 7 | They are to the coastal peoples of Papua New Guinea, Papua New Guinea. 8 | Since 2000, the winner of the Kate Greenaway Medal has also been given to the Colin Mears Award of the Kate Greenaway Medal. 9 | After the drummers are dancers, who often play the sogo (a small drum that makes almost no sound). They are often seen as a group of people in the group. 10 | The NASA Cassini orbiter is named after the Italian-French astronomer Giovanni Domenico Cassini, and the ESA Huygens probe, named after the Dutch astronomer, mathematician and physicist Christiaan Huygens. 11 | Alessandro Mazzola (born 8 November, 1942) is a former Italian football player. 12 | It was first thought that the debris thrown up by the crash filled in the smaller craters. 13 | Graham went to Wheaton College from 1939 to 1943. He went to Wheaton College in anthropology. 14 | However, the BZÖ is different in comparison to the Freedom Party. This is because a referendum about the Lisbon Treaty but against an EU-Withdrawal. 15 | Many species had vanished by the end of the nineteenth century, with European people. 16 | In 1987 Wexler became part of the Rock and Roll Hall of Fame. 17 | In its pure form, dextromethorphan can be found as a white powder. 18 | Admission to Tsinghua is very popular. 19 | Today NRC is started as an independent, private foundation. 20 | It is located at the coast of the Baltic Sea, where it is next to the city of Stralsund. 21 | He was also named in 1982, and was named in 1982 by Sports Illustrated. 22 | Fives is a British sport. It comes from the same origin as many racquet sports. 23 | For example, King Bhumibol was born on Monday, so on his birthday in Thailand it will be decorated with yellow color. 24 | Both names were used in 2007 when they were joined into the National Museum of Scotland. 25 | Tagore gave many styles, including craftwork from northern New Ireland, Haida carvings from the west coast of Canada (British Columbia), and woodcuts by Max Pechstein. 26 | On October 14, 1960, Presidential candidate John F. Kennedy proposed the idea of what became the Peace Corps on the steps of Michigan Union. 27 | She performed for President Reagan in 1988's "Great Performances" at the White House series, which was on the Public Broadcasting Service. 28 | Perry Saturn (with Terri) defeated Eddie Guerrero to win the WWF European Championship (8: 10) Saturn pinned Guerrero after a Diving elbow drop. 29 | She stayed in the United States until 1927 when she and her husband went back to France. 30 | Despina was found in late July, 1989 from the images taken by the Voyager 2 probe. 31 | The first Italian Grand Prix championship took place on 4 September 1921 at Brescia, Italy. 32 | He also wrote two short stories called The Ribbajack & Other Curious Yarns and Seven Strange and Ghostly Tales. 33 | At the Voyager 2 images Ophelia appears as a stretched object, the major pointing towards Uranus. 34 | The British decided to stop him and take the land by force. 35 | Some towns on the Eyre Highway in the south-east corner of Western Australia, between the South Australian border almost as far as Caiguna, do not follow the Western Australian time. 36 | In architectural decoration Small pieces of colored shell have been used to make shell shells and inlays. These have been used for decorate walls, furniture and boxes. 37 | Other cities on the Palos Verdes Peninsula include Rancho Palos Verdes, Rolling Hills Estates and Rolling Hills. 38 | Fearing that Drek will destroy the galaxy, Clank asks Ratchet to help him find the famous Captain Qwark, to stop Drek. 39 | It is not actually a true louse. 40 | He says that a user-centered design process in product development cycles and also works towards popularizing interaction design as a mainstream discipline. 41 | The other editors who may have reported you, and the administrator who blocked you, are part of a conspiracy against someone half a world away they've never met in person. 42 | Working Group I: Assessesses look like the climate system and climate change. 43 | The island is part of the Hebrides. It is separated from the Scottish mainland and from the Inner Hebrides by the stormy waters of the Minch, the Little Minch and the Sea of the Hebrides. 44 | Orton was married to Alanna Marie Orton on July 12, 2008. 45 | Formal minor planets are number-name combinations which are written by the Minor Planet Center, a branch of the IAU. 46 | By early on September 30, wind shear began to become more popular and a weakening trend began. 47 | Each entry has a datum (a nugget of data) which is a copy of a datum in some backing store. 48 | Because of this, many mosques will not have violations, both men and women when attending a mosque must go to these guidelines. 49 | Mariel of Redwall is a fantasy book written by Brian Jacques in 1991. 50 | Ryan Prosser (born 10 July 1988) is a rugby union player for Bristol Rugby in the Guinness Premiership. 51 | The ICJ reports about four reports, three of them from its working groups. 52 | Their granddaughter Hélène Langevin-Joliot is a professor of nuclear physics at the University of Paris, and his grandson Pierre Joliot, who was named after Pierre Curie. 53 | This stamp remained the standard letter stamp for the rest of Victoria's reign. Most of them were printed. 54 | The International Fight League was an American mixed martial arts (MMA) promotion that was started by the MMA. 55 | Giardia lamblia (also called Lamblia intestinalis and Giardia duodenalis) is a flagellated parasite that reproduces in the small intestine, causing giardiasis. 56 | Cameron has often worked in Christian-themed productions, among them the post-Rapture films Left Behind: The Movie, Left Behind II: Tribulation Force, and Left Behind: World at War I/O. He has also made many films. 57 | This was the area east of the mouth of the Vistula River. It was later called "the land of Prussia". 58 | He went back to Yerevan to teach at the local Conservatory. He later became the artistic director of the Armenian Philarmonic Orchestra. 59 | The story of Christmas is based on the story of the story of the Gospel of Matthew, the Gospel of Luke, and the Gospel of Luke. 60 | Weelkes was later to find himself in trouble with the Chichester Cathedral authorities because of his heavy drinking behavior. 61 | The episodes have been included Vic Reeves, Nancy Sorrell, Gaby Roslin, Scott Mills, Mark Chapman, Simon Gregson, Sue Cleaver, Carol Thatcher, Paul OGrady and Lee Ryan. 62 | It was found by Stephen P. Synnott in images from the Voyager 1 space probe taken on March 5, 1979 while orbiting around Jupiter. 63 | Gomaespuma is a Spanish radio show, hosted by Juan Luis Cano and Guillermo Fesser. 64 | On 16 June 2009, the official release date of The Resistance was said to be on the band's website. 65 | He is also a member of the Jungiery boyband 183 Club. 66 | The Apostolic Tradition said that theologian Hippolytus would singing the Hallel psalms with Alleluia as the refrain in early Christian agape feasts. 67 | In return, Rollo swore fealty to Charles, changed to Christianity. This would defend the northern region of France against other Viking groups. 68 | It comes from Voice of America (VoA) Special English. 69 | Disney received a full-size Oscar statuette and seven miniature ones. She was given to him by 10 - year old child actress Shirley Temple. 70 | It was the first asteroid to be found by a spacecraft. 71 | Hinterrhein is a district of the canton of Graubünden, in Switzerland. 72 | Bohemian Switzerland is a country in the Czech Republic. 73 | This leads to people using this confusion when 220 (1,048,576) bytes is called 1 MB (megabyte) instead of 1 MiB. 74 | The incident has been the subject of many reports as to people who study ethics. 75 | The animal may be better so that the animal may be more docile or may put on weight more quickly. 76 | Seventh sons have strong power knacks (specific magical abilities), and seventh sons of seventh sons are both very rare and powerful. 77 | Benchmarking started by PassMark Software in the 2009 version's 52 second install time, 32 second scan time, and 7 MB memory use. 78 | Volterra is a city in the region of Tuscany in Italy. 79 | Historically, itch and pain have not been considered to be independent of each other until recently, where it was found that itch has several features in common with pain, but has many different differences. 80 | The tongue is sticky because of the presence of mucous and glycoprotein-rich mucous. These are both lubricates movement in and out of the snout and helps to catch ants and termites. 81 | The same tram had taken over on 30 May 2006 at Starr Gate loop during last trials. 82 | There are many statues of Sir Alf Ramsey and Sir Bobby Robson. There are many former Ipswich Town in England. 83 | Take the square root of the variance. 84 | The Volunteers gave food, blankets, water, children's toys, and a live rock band performance for those at the stadium. 85 | It is found in the region Pays de la Loire in the Sarthe department in the west of France. 86 | If there are no strong land use controls, buildings are built along a bypass, using it into an ordinary town road. The bypass may eventually be used as the local streets it was meant to avoid. 87 | It is also an important point for people who live in Cooktown, Cape York Peninsula, and the Atherton Tableland. 88 | Bruises often cause pain but are not normally dangerous. 89 | None of the authors, for example, sponsors, administrators, vandals, or anyone else connected with Wikipedia, in any way whatsoever, can be responsible for your use of the information contained in or linked from these web pages. 90 | George Frideric Handel also served as Kapellmeister for George, Elector of Hanover, who later became George I of Great Britain. 91 | Their eyes are quite small, and their eyes are poor. 92 | They are made up of biological materials in toughness only by chitin. 93 | Oregano is an indispensable ingredient in Greek cuisine. 94 | Tickets can be made up of National Rail services, the Docklands Light Railway and Oyster card. 95 | These works he produced and published himself. His much larger woodcuts were mostly made work. 96 | The historical method includes the techniques and guidelines by which historians use primary sources and other evidence to research and then to write history. 97 | The sheer weight of the continental icecap sitting on top of Lake Vostok is thought to help make the high oxygen concentration. 98 | In 2000, the population was 89,148. 99 | Aliteracy (sometimes spelled alliteracy) is the state of being able to read. It is not possible in doing so. 100 | Mifepristone is a chemical compound. Its chemical formula is Pharmaceutical. 101 | It will then sink back to the river bed in order to stop its food and wait for its next meal. 102 | Also, research has shown children are less likely to report a crime if it involves someone that he or she knows, trusts, and / cares about it. 103 | Today, Landis' father has become a supporter of his son. He has also become one of Floyd's biggest fans. 104 | Shortly after reaching Category 4 status, it became a Category 4 hurricane, and became a Category 4 hurricane. 105 | The price of a certain type of work for a certain type of work is called a wage. 106 | Convinced that the grounds were haunted, they decided to publish their new books in a book An Adventure (1911), under the pseudonym of Elizabeth Morison and Frances Lamont. 107 | He lived in London, and went to work himself chiefly to practical teaching. 108 | Brunstad has many fast food restaurants, including a restaurant, coffee bar, and a grocery store. 109 | He left a detachment of 11,000 troops to take over the new region. 110 | In 1438 Trevi passed under the rule of the Church as part of the legation of Perugia. The first part of the Trevith its history was that of the States of the Church, then (1860) with the united Kingdom of Italy. 111 | The depression moved inland on the 20th as a tropical depression, and dissipated the next day over Brazil, where it caused heavy rains and flooding. 112 | The New York City Housing Authority Police Department was a police department in New York City. It was started in 1952 by New York City. 113 | The band's current band members are Flynn (vocals, guitar), Duce (bass), Phil Demmel (guitar), and Dave McClain (drums). 114 | Advocacy Countries with a minority Muslim population are more likely to be Muslim-majority countries of the Greater Middle East to use mosques as a way to promote civic participation. 115 | The characters are different from their earlier characters Pete and Dud. 116 | Johan was also the first person to play the Swedish power metal band HammerFall. The band quit before they released a studio album. 117 | In 1998, Culver ran for Iowa Secretary of State and was made a victorious. 118 | In 1990, Mark Messier took the Hart over Ray Bourque by two votes. The difference was a single first-place vote. 119 | Shade sets the main plot of the novel in motion when he looks like that law. He started a chain of events that leads to the destruction of his colony's home, forcing their premature migration, and his separation from them. 120 | The female is called a daughter. 121 | He was diagnosed with inoperable cancer in April 1999. 122 | Before the storm came to the National Park Service, the National Park Service closed places and campgrounds along the Outer Banks. 123 | The form of chess played is speed chess in which each player has a total of twelve minutes for the whole game. 124 | Amazon Basin is the part of South America. It is made up of the Amazon River and the Amazon River. 125 | The two former presidents were later charged with mutiny and treason for their roles in the 1979 coup in the 1980 Gwangju massacre. 126 | Moderate to bad damage reached the Atlantic coastline and as far as West Virginia. 127 | Because the owner is unaware, these computers are called metaphorically compared to zombies. 128 | The wave moved across the Atlantic Ocean. It became a tropical depression off the northern coast of Haiti on September 13. 129 | For example, the stylebook of the Associated Press is updated each year. 130 | The four canonical texts are the Gospel of Matthew, Gospel of Mark, Gospel of Luke and Gospel of John, and the Gospel of John. They are probably written between AD 65 and 100. 131 | Since the end of the 19th century, Eschelbron is well known for its large amount of money. 132 | The upper half is also the coat of arms of the former district of Oberbarnim. 133 | Unlike the clouds on Earth, however, it is made up of crystals of ice, Neptune's clouds are made up of different crystals. 134 | Their work is usually limited until they reach legal adulthood. 135 | Development Stable releases are not common, but there are often Subversion snapshots that use enough to use. 136 | In 1482 the Order sent him to Florence, the city of his gods sent him to Florence. 137 | In the Soviet years, the Bolsheviks destroyed two of Rostov's main cathedrals: St Alexander Nevsky Cathedral (1908) and St George Cathedral in Nakhichevan (1783 - 1807). 138 | He died on May 29, 1518 in Madrid, Spain. He was buried in the church of San Benito. 139 | This was shown in the Miller-Urey experiment by Stanley L. Miller and Harold C in 1953. 140 | Cogeneration (also combined heat and power, CHP) is the use of a heat engine or power station. It can also be used both electricity and useful heat. 141 | However, the male "den master" will also allow a second male into the den; the reason for this is not clear. 142 | A Wikipedia gadget is a JavaScript and / snippet that can be made simply by checking an option in your Wikipedia preferences. 143 | Below is some useful links to help with your involvement. 144 | He became Prime Minister of Egypt between 1945 and 1946. He was again from 1946 to 1948. 145 | She was left behind the island when the rest of the Nicoleños were moved to the mainland. 146 | James I became a Gentleman of the Chapel Royal in 1615. He became an organist at least 1615 until his death. 147 | Chauvin was embarrassed to get his award and first said that he may not accept it. 148 | Later, Esperanto speakers began to see the language and the culture that had grown up around it as ends in themselves, even if Esperanto is never used by the United Nations or other international organizations. 149 | Dry air wrapping around the southern edge of the storm eroded most of the deep convection by early on September 12. 150 | Calvin Baker is a book written by Calvin Baker. 151 | Eva Anna Paula Braun, born Eva Anna Paula Hitler (February 6, 1912 - April 30, 1945) was the wife of Adolf Hitler. 152 | Each version of the License is given a different version number. 153 | Most IRC servers do not need users to make an account, but a user will have to set a nickname before being connected. 154 | That same year he also got a mechanics certificate. He became the youngest certificate in New York at the same time. 155 | SummerSlam (2009) is a professional wrestling pay-per-view event made by World Wrestling Entertainment (WWE). It will take place on August 23, 2009 at Staples Center in Los Angeles, California. 156 | He is usually seen as being bald, with long whiskers. He is said to be an incarnation of the Southern Polestar. 157 | A few animals have chromatic response, changing color in changing environments, either seasonally (snowshoe hare) or far more rapidly with chromatophores in their integument (the cephalopod family). 158 | Val Venis defeated Rikishi in a Steel match to retain the WWF Intercontinental Championship (14: 10) Venis pinned Rikishi after Tazz hit Rikishi with a TV camera. 159 | This closely looks like the Unix philosophy of having more than one program doing one thing well and working together. 160 | He came from a musical family. His mother, LaRue, was an assistant and singer, and his father Keith Brion, was a band director at the Yale University. 161 | Mennonites are in Canada, Democratic Republic of Congo and the United States. However, Mennonites can also be found in tight-knit communities in at least 51 countries on six continents of those countries. 162 | Naas is a big group of people living in Dublin. Many people living in Naas and working in Dublin. 163 | Acanthopholis' armour was made of oval plates set almost horizontally into the skin. It also had a protruding from the neck and shoulder area, along the spine. 164 | Origin Irmo was first built on Christmas Eve in 1890 because of the opening of the Columbia, Newberry, and Laurens Railroad. 165 | It was proposed by the Law Commission. The bills start in the House of Lords in the House of Lords. 166 | In the years before his final release in 1474, he became known as the reconquest of Wallachia. Vlad lived with his new wife in a house in the Hungarian capital. 167 | You may add a passage of up to five words as a Front-Cover Text, and a way of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. 168 | He is buried in the Restvale Cemetery in Alsip, Illinois. 169 | Bone marrow is a tissue found in the tissue that can be found in bones. 170 | Reflection nebulae are usually blue because the scattering is better for blue light than red. This is the same scattering process that gives us blue skies and red sunsets. 171 | It is found in the region Provence-Alpes-Côte dAzur in the Vaucluse department in the south of France. 172 | MacGruber starts asking for simple objects to make something to do with the bomb, but he is later distracted by something (usually involving his personal life) that makes him run out of time. 173 | Messiaen died, and Yvonne Loriod had the last movement of this time with advice from George Benjamin at the same time. 174 | Shi'a Muslims consider Karbala to be one of their holiest cities after Mecca, Medina, Jerusalem and Najaf. 175 | The PAD is called for the resignation of the governments of Thaksin Shinawatra, Samak Sundaravej and Somchai Wongsawat. The PAD is thought to be a proxies for Thaksin. 176 | However travel through very remote areas, on isolated tracks, need to change planning and a good vehicle (usually a four wheel drive). 177 | At Kahn he was the chief architect for the Fisher Building in 1928. 178 | He tells him that he has to leave for rehearsal, and he and Drön leave. 179 | Britpop comes from the British independent music scene of the early 1990s. The music was started by the British guitar pop music of the 1960s and 1970s. 180 | This was made into a group of battalions being made for XI International Brigade. 181 | The Sheppard line currently has fewer users than the other two subway lines, and shorter trains are run. 182 | It has a capacity of 98,772 people. It is the largest stadium in Europe, and the second largest stadium in the world. 183 | Ten Boom was named after one of the Righteous Among the Nations by the State of Israel in 1967. 184 | Some articles are very long and rich in content. Other articles are shorter and of lesser quality. 185 | About 95 species are currently accepted. 186 | Eugowra is said to be named after the Indigenous Australian word meaning "the place where the sand washes down". 187 | Terms such as the "Undies" in English for underwear and "Undies" movie style are oft-heard terms in English. 188 | Jurisdiction is a term that comes from public international law, conflict of laws, constitutional law and the powers of the government to make the government best serve the needs of its native society. 189 | He made many other pieces about Hiawatha: The Death of Minnehaha, Overture to The Song of Hiawatha and Hiawatha's Departure. 190 | The capital city of the state is Aracaju. 191 | Despite this, Farrenc was paid less than her male counterparts for nearly ten years. 192 | Gumbasia was created in a style of Vorkapich called Kinesthetic Film Principles. 193 | Brandon (Waise Lee), became his idol, and MK Sun grew up to be a lawyer. 194 | ISBN 1 - 876429-3 is a small town near Cowra in the central west of New South Wales, Australia. It is in Cabonne Shire. 195 | Military career Donaldson joined the Australian Army on 18 June 2002. 196 | Prospectors from California, Europe and China were also digging along the Peel River and the mountain slopes. 197 | Before the long time, it was the most commonly used calculation tool in science and engineering. 198 | The Kindle 2 features 16 - level grayscale display, improved battery life, 20% faster page-refreshing, a text-to-speech option to read the text aloud, and thickness reduced from 0.8 to 0.36 inches (9.1 millimeters). 199 | Yoghurt, also known as yogurt, is a dairy product made by milk milk. 200 | Seventy-five defencemen are in the Hall of Fame, more than any other current position. Only 35 goaltenders have been added. 201 | Alternative views on the subject have been proposed throughout the centuries (see below), but all people did not like Christians. 202 | However, the album was banned from many different countries. 203 | The legs are wide at the top, and are narrow at the top. 204 | In late 2004, Suleman made headlines by cutting Howard Stern's radio show from four Citadel stations. This was because he wanted to move to Sirius Satellite Radio. 205 | The company opened twice as many Canadian stores as McDonald's Hospital Wendy's confirms Tim Hortons IPO by the Ottawa Business Journal, December 1, 2005, and also sold the sales of McDonald's Canadian company as of 2002. 206 | Plot Captain Caleb Holt (Kirk Cameron) is a firefighter in Albany, Georgia. It is also known as the Cardinal rule of all firemen, who leave the partner behind him. 207 | He won the presidential election held on 2 March 2008 with 71.25% of the popular vote. 208 | The plant is thought to be a living fossil. 209 | In 1990, she was the only female entertainer to perform in Saudi Arabia. 210 | Stravinsky first wrote the music for writing the ballet in 1913. 211 | Protests across the country were stopped. 212 | Offenbach's many operettas, such as Orpheus in the Underworld, and La belle Hélène, were very popular in both France and the English-speaking world during the 1850s and 1860s. 213 | Roof dating back to the Tang Dynasty with this symbol has been found west of the ancient city of Chang'an (modern-day Xian). 214 | Jeanne Demessieux (born Paris, 13 February 1921; died Paris, 11 November 1968), was a French organist and composer. 215 | By most people, the instrument was nearly impossible to control. 216 | Santa Maria Maggiore (St. Mary the Greater), the first church in Assisi. 217 | Characteristics Radar says that there is a fairly pure iron-nickel composition. 218 | Railway Gazette International is a monthly business journal. It is made up of the railway, metro, light rail and tram industries. 219 | He was given the Companion of Honour in 1988. 220 | Loèche harbours include Onyx, the Swiss interception system for electronic intelligence gathering. 221 | A matchbook is a small cardboard folder (matchcover) inside a quantity of matches. It has a coarse on the outside. 222 | She was one of the first doctors to find out how to cigarette smoking around children, and use in pregnant women. 223 | Defiantly, she went to never renounce the Commune. She dared the judges to sentence her to death. 224 | OEL manga series Graystripe's Trilogy There is a three first English-language manga series following Graystripe. The series was made by Twolegs in Dawn until he returned to ThunderClan in The Sight. 225 | Samovar & Porter (1994), p. 84 Syrians did not take part in the urban area; many of the immigrants who had worked as peddlers were able to work with Americans on a daily basis. 226 | He was also famous for his prints, book covers, posters, and garden metalwork furniture. 227 | During childhood she had pneumonia twice, and she had pneumonia 4 - 5 times a year, a ruptured appendix, and had a tonsillar cyst. 228 | Dr. David Lindenmeyer (Australian National University) has said that the need for nest boxes show that logging practices are not ecologically sustainable. This means that Leadbeater's possum can be found. 229 | The Montreal Canadiens are an ice hockey team in the National Hockey League (NHL). 230 | Small value inductors can also be built on integrated circuits. These are used to make transistors. 231 | The term "gribble" was first used for the wood-boring species, especially the first species described from Norway by Rathke in 1799. 232 | The wounds inflicted by a club are usually known as bludgeoning or blunt-force injuries. 233 | Thereafter the county's government was done at Duns or Lauder until Greenlaw became the county town in 1596. 234 | No skater can be very good for a quadruple Axel in competition. 235 | From the telephone exchange, the Port Jackson District Commandant could be used to talk with all military places on the harbour. 236 | However, even to those who enter the prayer hall of a mosque without making of praying, there are still rules that use. 237 | It is described as pointed in the face and about the size of a rabbit. 238 | Computer performance is different from the amount of useful work done by a computer system compared to the time and resources used. 239 | Some of the largest lakes in the world can be found along the Volga. 240 | The crosier symbolises the monasteries of the region. 241 | Human skin can be found from very dark brown to very pale pink. 242 | Bankers from ShoreBank, a community development bank in Chicago, helped Yunus with the official bank of the Ford Foundation at the time. 243 | Bremer reported plans to put Saddam on trial. However, the details of such a trial had not yet been found. 244 | Representatives of the Professional Hockey Writers' Association vote for the All-Star Team at the end of the season. 245 | Tajikistan, Turkmenistan and Uzbekistan borders Afghanistan to the north, Iran to the south, and the People's Republic of China to the east. 246 | Nupedia was founded on March 9, 2000. It was started by Bomis, Inc., a web portal company. 247 | Notable features of the design include key-dependent S-boxes and a very complex key schedule. 248 | Iain Grieve (born 19 February 1987 in Jwaneng, Botswana) is a rugby union player for the Bristol Rugby in the Guinness Premiership. 249 | Other nearby settlements include Pont-Bellanger and Beaumesnil. 250 | The first model was proposed by George Zweig in 1964 by physicists Murray Gell-Mann and George Zweig. 251 | The fourth ring was added in 1938 when the column was moved to its present location, and was added to its present location. 252 | West Berlin had its own government, separate from West Germany's, which had its own postage stamps until 1990. 253 | The Primavera is a painting by the Italian Renaissance painter Sandro Botticelli. 254 | New South Wales is the capital city of Sydney, Australia. 255 | Most of the time, the polymer is most often epoxy, but other polymers, such as polyester, vinyl ester, or nylon. 256 | The name survives as a brand for a series of different spin-off television channels, digital radio station, and website which have lived in the magazine. 257 | At four-and-a-half years old he was left to fend for himself on the streets of northern Italy for the next four years, living in towns with groups of other homeless children. 258 | Stands were added behind each set of goals during the 1980s and 1990s as the ground began to be more popular. 259 | A town may be described as a market town or as having market rights even if it no longer has a market, and still has the right to do so. 260 | A bastion on the eastern side was built later. 261 | Events July 29, Battle of Stiklestad (Norway): Olav Haraldsson is killed in the battle of Stiklestad, Norway. 262 | Others have said that Tresca was eliminated by the NKVD, because there was criticism of the Stalin government of the Soviet Union. 263 | This caused both Montenegro and Serbia to become an independent country. 264 | Use HTML and CSS only had a good reason and only with good reason. 265 | Schuschnigg later said that there was publicly that reports of riots were false. 266 | Addiscombe is a town in the London Borough of Croydon, England. 267 | Another closely-related meaning of constituent is that of a person living in the area governed, represented, or otherwise served by a politician; sometimes this is used for citizens who elected the politician. 268 | Prunk is a member of Institute of European History in Mainz. He was also a member of the Center for European Integration Studies in Bonn. 269 | Stallone also had a cameo appearance in the 2003 French film Taxi 3 as a passenger. 270 | Instead, the crew said that a trailer had a trailer with a ship called a "cantilevered arm". They shot the scene while riding up Templin Highway north of Santa Clarita. 271 | The conference is based on the next year in a bookMicroeconomic Foundations of Employment and Inflation Theory by Phelps et al. 272 | Wario Land The Wario Land series is a series of video games that started with Wario Land: Super Mario Land 3 and Super Mario Land 3. 273 | Chopin's Opus 57, Frédéric Chopin, is a piano player. 274 | These attacks may have been different in origin rather than physical. 275 | A historian has said that he was quinine's efficacy. He said that he gave some opportunities to swarm into the Gold Coast, Nigeria and other parts of west Africa. 276 | Because of this, spectroscopic studies have shown evidence of hydrated minerals and silicates, which show a stony surface. 277 | She became the editor of her husband's works for Breitkopf und Härtel. 278 | Mercury is similar in appearance to the Moon. It is very similar to regions of smooth plains, and has no moons and no big atmosphere. 279 | Geography The town is located in the Limmat valley between Baden and Zürich. 280 | These include good habitat for chinkara, hog deer and blue bull. 281 | After the Sena dynasty, Dhaka was ruled by the Turkish and Afghan governors from the Delhi Sultanate before the Mughals arrived in 1608. 282 | The Prime Minister stays in office only as long as he or she has the support of the lower house. 283 | For Rowling, this scene is important because it shows Harry's bravery, and Cedric's corpse, he shows selflessness and compassion. 284 | On June 1, 1972, he and fellow RAF members Jan-Carl Raspe and Holger Meins were killed when they were shootout in Frankfurt. 285 | Together they formed New Music Manchester, a group made up of modern music. 286 | Hurricane Mitch caused extreme damage in the upper Florida Keys, as a storm surge of about 18 to 20 feet affected the region. 287 | It is now the site of Meher Baba's samadhi (tomb-shrine) as well as places where people live. 288 | The collapsed dome of the main church has been taken over by the church. 289 | In 2005, Meissner became the second American woman to get the first Axel jump in national competition. 290 | Salem is a city in the state of Massachusetts in the United States. 291 | Forty-nine species of pipefish and nine species of seahorse have been found. 292 | Saint Martin is a tropical island in the northeast Caribbean, about 300 km east of Puerto Rico. 293 | However, these PDFs can not be found without further manipulation if they have images. 294 | In April 1862, Ben was arrested on the orders of Police Inspector Sir Frederick Pottinger. He took part in the company of Frank Gardiner in the police. 295 | Heavy rain fell across parts of Britain on October 5. This caused flood water to flood the waters. 296 | Version 2009.1 provides a USB installer to create a Live USB, where the user's configuration and personal data can be saved if wanted. 297 | In this case, there were two members, Christian Democratic People's Party (CVP): 2 members, Social Democratic Party (SP): 2 members, Swiss People's Party (SVP): 2 members, Social Democratic Party (SP): 2 members, and Swiss People's Party (SVP): 1 member. 298 | A fee is the price one pays for services, especially the honorarium paid to a doctor, lawyer, consultant, or other member of the government. 299 | Ohio State's library system includes twenty-one libraries located in the city of Columbus. 300 | In other developments, both Iceland and Greenland said that there was the overlordship of Norway, but Scotland was able to make a Norse invasion. 301 | The singles from the album were "In the Way Distribution", "Distribution", "Distribution", "Stop" and "Universally Speaking". 302 | In April 2000, MINIX became free / open source software under a permissive free software licence, but by this time other operating systems had become more important than the operating system for students and hobbyists. 303 | The body color varies from medium brown to gold-ish to beige-white. The color sometimes has dark brown spots, especially on the limbs. 304 | The Britannica was mostly a Scottish company. It was used by its thistle logo, the emblem of Scotland. 305 | The area covered by the warning was extended southwards as Jose strengthened, before being canceled soon after landfall on September 23. 306 | In August 2003, the San Diego Union Tribune said that U. Marine pilots and their commanders used Mark 77 firebombs on Iraqi Republican Guards during the first time of the war. 307 | The latter gave audiences with the sort of information later given by intertitles, and can help historians imagine what the film may have been like. 308 | That is because real estate, businesses and other things in the underground city of economies of the Third World can not be used as well as making money industrial and commercial expansion. 309 | He moved from Sydney Cove several times before being shot dead in 1796. 310 | Ned and Dan went back to the police camp. They ordered them to surrender. 311 | Before the second game got underway, the press agreed that the using midget-in-a-cake's standard had not been up to Veeck's current standard. 312 | In a short video promoting the charity Equality Now Joss Whedon said that the movie was not done, Fray is coming back. 313 | A mutant is a fictional character in a comic book, published by marvel comics. 314 | The SAT Reasoning Test (used to be called Scholastic Aptitude Test and Scholastic Assessment Test) is a test for college admissions in the United States. 315 | Civil unrest in northern Italy has the medieval musical form of Geisslerlieder. The songs were sung by bands of Flagellants. 316 | Some reports read that different things make up the likelihood of both paralysis and hallucinations. 317 | He went to Australia for seven years to travel for seven years. 318 | Waugh writes that Charles had been styled in search of love in those days, when he first met Sebastian, found out that low door in the wall had been in search of love in those days. This was a metaphor that tells the work on a number of levels. 319 | Her friendship with the Russian mystic Grigori Rasputin was also an important factor in her life. 320 | The term dorsal means anatomical structures that are either found in or grow off that side of an animal. 321 | The term "excavation" was first used by Berzelius, after Mulder found that all proteins seemed to have the same formula, and might be made of a single type of molecule (very large). 322 | After the Jerilderie raid, the gang moved to the city for 16 months. 323 | It is found in the region Basse-Normandie in the Calvados department in the northwest of France. 324 | Color can be found from orange to pale yellow. 325 | In 1963 an extension was added, with the north from Union station to the station, below University Avenue and Queen's Park to near Bloor Street, where it turned west to end at St. George and Bloor Streets. 326 | Before 1980, a part of the Commonwealth Railways Central Australian Line passed along the western side of the Simpson Desert. 327 | It is located on an old portage trail. It led west through the mountains to Unalakleet. 328 | People with cardiomyopathy often have a risk of heart cardiac death or both. 329 | As the largest sub-region in Mesoamerica, it became a very big and varied landscape, from the mountainous regions of the Sierra Madre to the plains of northern Yucatán. 330 | Google then made the comic available on Google Books and mentioned it on its official blog along with the early release of Google. 331 | Anyone may register a pedigree with the college, where they are carefully audited and need official proofs before being changed. 332 | The book, Political Economy, was published in 1985, but it was not published until 1985. 333 | He toured with the IPO in the spring of 1990 for their first-ever performance in the Soviet Union, with concerts in Moscow and Leningrad, and toured with the IPO again in 1994, performing in China and India. 334 | Napoleonic Wars: Austrian General Mack surrenders his army to the Grand Army of Napoleon at Ulm. This was because Napoleon over 30,000 prisoners had to lose 10,000 people. 335 | The city has long been the economic centre of northern Nigeria, and a center for the production of groundnuts. 336 | Most of South Indians speak one of the five Dravidian languages, the Malayalam, Tamil, Telugu, Telugu, and Tulu. 337 | Meteora also won many awards and honors. 338 | After a short time, the WWF cavalry turned around and attacked Kane and Jericho. 339 | Most of the songs were written by Richard M. Sherman and Robert B. Sherman. 340 | In the 5th century Slavs started to move into the area. 341 | From 1900 to 1920 many new facilities were built on campus, including buildings for the dental and pharmacy programs, a chemistry building for the natural sciences, Hill Auditorium, large hospital and library complexes, and two home halls. 342 | Winchester is a city of Illinois in the United States. 343 | Name Arzashkun seems to be the Assyrian form of an Armenian name ending in -ka. This name comes from Arzashkun, which means Arsene, Arsissa by the ancients to part of Lake Van. 344 | Out of 16,421 people living in the national casting, she was chosen among the 15 people to appear on the TV show. 345 | Its episodes were shown on the ABC network from September 21, 1993 to March 1, 2005. 346 | The device can then be made and used as a source of environments. 347 | Gimnasia hired first success with Colombian trainer Francisco Maturana, and then Julio César Falcioni, but both had very little success. 348 | Brighton is a city of Iowa in the United States. 349 | She also appeared in several music videos, including "Cap It Girl" by John Oates and "Land Just Lose It" by Eminem. 350 | On June 24 1979, on the 750th anniversary of the village, Glinde became a town. 351 | Pauline went back in the Game Boy remake of Donkey Kong in 1994, and later Mario vs. Donkey Kong 2: March of the Minis in 2006. However, the character is now described as the new character in the series. 352 | The vagina is very elastic and stretches to many times its normal diameter during a vaginal birth. 353 | His real date of birth was never recorded, but it is thought to be between 1935 and 1939. 354 | This measure indicates how much of a particular drug or other substance (inhibitor) is needed to make a given biological process (or part of a process, i.e. an enzyme, cell receptor or microorganism) by half. 355 | Although the name suggests that they are located in the Bernese Oberland region of the canton of Bern, parts of the Bernese Alps are next to Valais, Lucerne, Obwalden, Fribourg and Vaud. 356 | There he had one daughter, Mary Ann Fisher Power, who was later married to Ann (e) Power. 357 | During an interview, Edward Gorey said that Bawden was one of his favorite artists. He said that not many people remembered or knew about this best artist. 358 | The string can make different notes in different modes just as a guitar string can produce different notes. Each string appears as a different particle: electron, photon, gluon. 359 | Gable also won an Academy Award nomination when he played Fletcher Christian in 1935's Mutiny on the Bounty. 360 | -------------------------------------------------------------------------------- /system_output/other_formats/test.pred.tok: -------------------------------------------------------------------------------- 1 | One side of the armed conflict is made up of the Sudanese military and the Janjaweed , a Sudanese militia group brought mostly from the Afro-Arab Abbala tribes of the northern Rizeigat region in Sudan . 2 | Jeddah is the main gateway to Mecca , Islam 's holiest city . They can be able to visit at least once in their lifetime . 3 | The Great Dark Spot is thought to be a hole in the cloud deck of Neptune . 4 | His next work , Saturday , is an eventful day in the life of a very successful neurosurgeon . 5 | The tarantula , the trickster character , spun a black cord and , attaching it to the ball , pulled away fast to the east , pulling on the cord with all his strength . 6 | There he died six weeks later on January 13 , 888 . 7 | They are to the coastal peoples of Papua New Guinea , Papua New Guinea . 8 | Since 2000 , the winner of the Kate Greenaway Medal has also been given to the Colin Mears Award of the Kate Greenaway Medal . 9 | After the drummers are dancers , who often play the sogo ( a small drum that makes almost no sound ) . They are often seen as a group of people in the group . 10 | The NASA Cassini orbiter is named after the Italian-French astronomer Giovanni Domenico Cassini , and the ESA Huygens probe , named after the Dutch astronomer , mathematician and physicist Christiaan Huygens . 11 | Alessandro Mazzola ( born 8 November , 1942 ) is a former Italian football player . 12 | It was first thought that the debris thrown up by the crash filled in the smaller craters . 13 | Graham went to Wheaton College from 1939 to 1943 . He went to Wheaton College in anthropology . 14 | However , the BZÖ is different in comparison to the Freedom Party . This is because a referendum about the Lisbon Treaty but against an EU-Withdrawal . 15 | Many species had vanished by the end of the nineteenth century , with European people . 16 | In 1987 Wexler became part of the Rock and Roll Hall of Fame . 17 | In its pure form , dextromethorphan can be found as a white powder . 18 | Admission to Tsinghua is very popular . 19 | Today NRC is started as an independent , private foundation . 20 | It is located at the coast of the Baltic Sea , where it is next to the city of Stralsund . 21 | He was also named in 1982 , and was named in 1982 by Sports Illustrated . 22 | Fives is a British sport . It comes from the same origin as many racquet sports . 23 | For example , King Bhumibol was born on Monday , so on his birthday in Thailand it will be decorated with yellow color . 24 | Both names were used in 2007 when they were joined into the National Museum of Scotland . 25 | Tagore gave many styles , including craftwork from northern New Ireland , Haida carvings from the west coast of Canada ( British Columbia ) , and woodcuts by Max Pechstein . 26 | On October 14 , 1960 , Presidential candidate John F. Kennedy proposed the idea of what became the Peace Corps on the steps of Michigan Union . 27 | She performed for President Reagan in 1988 's '' Great Performances '' at the White House series , which was on the Public Broadcasting Service . 28 | Perry Saturn ( with Terri ) defeated Eddie Guerrero to win the WWF European Championship ( 8 : 10 ) Saturn pinned Guerrero after a Diving elbow drop . 29 | She stayed in the United States until 1927 when she and her husband went back to France . 30 | Despina was found in late July , 1989 from the images taken by the Voyager 2 probe . 31 | The first Italian Grand Prix championship took place on 4 September 1921 at Brescia , Italy . 32 | He also wrote two short stories called The Ribbajack & Other Curious Yarns and Seven Strange and Ghostly Tales . 33 | At the Voyager 2 images Ophelia appears as a stretched object , the major pointing towards Uranus . 34 | The British decided to stop him and take the land by force . 35 | Some towns on the Eyre Highway in the south-east corner of Western Australia , between the South Australian border almost as far as Caiguna , do not follow the Western Australian time . 36 | In architectural decoration Small pieces of colored shell have been used to make shell shells and inlays . These have been used for decorate walls , furniture and boxes . 37 | Other cities on the Palos Verdes Peninsula include Rancho Palos Verdes , Rolling Hills Estates and Rolling Hills . 38 | Fearing that Drek will destroy the galaxy , Clank asks Ratchet to help him find the famous Captain Qwark , to stop Drek . 39 | It is not actually a true louse . 40 | He says that a user-centered design process in product development cycles and also works towards popularizing interaction design as a mainstream discipline . 41 | The other editors who may have reported you , and the administrator who blocked you , are part of a conspiracy against someone half a world away they 've never met in person . 42 | Working Group I : Assessesses look like the climate system and climate change . 43 | The island is part of the Hebrides . It is separated from the Scottish mainland and from the Inner Hebrides by the stormy waters of the Minch , the Little Minch and the Sea of the Hebrides . 44 | Orton was married to Alanna Marie Orton on July 12 , 2008 . 45 | Formal minor planets are number-name combinations which are written by the Minor Planet Center , a branch of the IAU . 46 | By early on September 30 , wind shear began to become more popular and a weakening trend began . 47 | Each entry has a datum ( a nugget of data ) which is a copy of a datum in some backing store . 48 | Because of this , many mosques will not have violations , both men and women when attending a mosque must go to these guidelines . 49 | Mariel of Redwall is a fantasy book written by Brian Jacques in 1991 . 50 | Ryan Prosser ( born 10 July 1988 ) is a rugby union player for Bristol Rugby in the Guinness Premiership . 51 | The ICJ reports about four reports , three of them from its working groups . 52 | Their granddaughter Hélène Langevin-Joliot is a professor of nuclear physics at the University of Paris , and his grandson Pierre Joliot , who was named after Pierre Curie . 53 | This stamp remained the standard letter stamp for the rest of Victoria 's reign . Most of them were printed . 54 | The International Fight League was an American mixed martial arts ( MMA ) promotion that was started by the MMA . 55 | Giardia lamblia ( also called Lamblia intestinalis and Giardia duodenalis ) is a flagellated parasite that reproduces in the small intestine , causing giardiasis . 56 | Cameron has often worked in Christian-themed productions , among them the post-Rapture films Left Behind : The Movie , Left Behind II : Tribulation Force , and Left Behind : World at War I/O. He has also made many films . 57 | This was the area east of the mouth of the Vistula River . It was later called '' the land of Prussia '' . 58 | He went back to Yerevan to teach at the local Conservatory . He later became the artistic director of the Armenian Philarmonic Orchestra . 59 | The story of Christmas is based on the story of the story of the Gospel of Matthew , the Gospel of Luke , and the Gospel of Luke . 60 | Weelkes was later to find himself in trouble with the Chichester Cathedral authorities because of his heavy drinking behavior . 61 | The episodes have been included Vic Reeves , Nancy Sorrell , Gaby Roslin , Scott Mills , Mark Chapman , Simon Gregson , Sue Cleaver , Carol Thatcher , Paul OGrady and Lee Ryan . 62 | It was found by Stephen P . Synnott in images from the Voyager 1 space probe taken on March 5 , 1979 while orbiting around Jupiter . 63 | Gomaespuma is a Spanish radio show , hosted by Juan Luis Cano and Guillermo Fesser . 64 | On 16 June 2009 , the official release date of The Resistance was said to be on the band 's website . 65 | He is also a member of the Jungiery boyband 183 Club . 66 | The Apostolic Tradition said that theologian Hippolytus would singing the Hallel psalms with Alleluia as the refrain in early Christian agape feasts . 67 | In return , Rollo swore fealty to Charles , changed to Christianity . This would defend the northern region of France against other Viking groups . 68 | It comes from Voice of America ( VoA ) Special English . 69 | Disney received a full-size Oscar statuette and seven miniature ones . She was given to him by 10 - year old child actress Shirley Temple . 70 | It was the first asteroid to be found by a spacecraft . 71 | Hinterrhein is a district of the canton of Graubünden , in Switzerland . 72 | Bohemian Switzerland is a country in the Czech Republic . 73 | This leads to people using this confusion when 220 ( 1,048,576 ) bytes is called 1 MB ( megabyte ) instead of 1 MiB . 74 | The incident has been the subject of many reports as to people who study ethics . 75 | The animal may be better so that the animal may be more docile or may put on weight more quickly . 76 | Seventh sons have strong power knacks ( specific magical abilities ) , and seventh sons of seventh sons are both very rare and powerful . 77 | Benchmarking started by PassMark Software in the 2009 version 's 52 second install time , 32 second scan time , and 7 MB memory use . 78 | Volterra is a city in the region of Tuscany in Italy . 79 | Historically , itch and pain have not been considered to be independent of each other until recently , where it was found that itch has several features in common with pain , but has many different differences . 80 | The tongue is sticky because of the presence of mucous and glycoprotein-rich mucous . These are both lubricates movement in and out of the snout and helps to catch ants and termites . 81 | The same tram had taken over on 30 May 2006 at Starr Gate loop during last trials . 82 | There are many statues of Sir Alf Ramsey and Sir Bobby Robson . There are many former Ipswich Town in England . 83 | Take the square root of the variance . 84 | The Volunteers gave food , blankets , water , children 's toys , and a live rock band performance for those at the stadium . 85 | It is found in the region Pays de la Loire in the Sarthe department in the west of France . 86 | If there are no strong land use controls , buildings are built along a bypass , using it into an ordinary town road . The bypass may eventually be used as the local streets it was meant to avoid . 87 | It is also an important point for people who live in Cooktown , Cape York Peninsula , and the Atherton Tableland . 88 | Bruises often cause pain but are not normally dangerous . 89 | None of the authors , for example , sponsors , administrators , vandals , or anyone else connected with Wikipedia , in any way whatsoever , can be responsible for your use of the information contained in or linked from these web pages . 90 | George Frideric Handel also served as Kapellmeister for George , Elector of Hanover , who later became George I of Great Britain . 91 | Their eyes are quite small , and their eyes are poor . 92 | They are made up of biological materials in toughness only by chitin . 93 | Oregano is an indispensable ingredient in Greek cuisine . 94 | Tickets can be made up of National Rail services , the Docklands Light Railway and Oyster card . 95 | These works he produced and published himself . His much larger woodcuts were mostly made work . 96 | The historical method includes the techniques and guidelines by which historians use primary sources and other evidence to research and then to write history . 97 | The sheer weight of the continental icecap sitting on top of Lake Vostok is thought to help make the high oxygen concentration . 98 | In 2000 , the population was 89,148 . 99 | Aliteracy ( sometimes spelled alliteracy ) is the state of being able to read . It is not possible in doing so . 100 | Mifepristone is a chemical compound . Its chemical formula is Pharmaceutical . 101 | It will then sink back to the river bed in order to stop its food and wait for its next meal . 102 | Also , research has shown children are less likely to report a crime if it involves someone that he or she knows , trusts , and / cares about it . 103 | Today , Landis ' father has become a supporter of his son . He has also become one of Floyd 's biggest fans . 104 | Shortly after reaching Category 4 status , it became a Category 4 hurricane , and became a Category 4 hurricane . 105 | The price of a certain type of work for a certain type of work is called a wage . 106 | Convinced that the grounds were haunted , they decided to publish their new books in a book An Adventure ( 1911 ) , under the pseudonym of Elizabeth Morison and Frances Lamont . 107 | He lived in London , and went to work himself chiefly to practical teaching . 108 | Brunstad has many fast food restaurants , including a restaurant , coffee bar , and a grocery store . 109 | He left a detachment of 11,000 troops to take over the new region . 110 | In 1438 Trevi passed under the rule of the Church as part of the legation of Perugia . The first part of the Trevith its history was that of the States of the Church , then ( 1860 ) with the united Kingdom of Italy . 111 | The depression moved inland on the 20th as a tropical depression , and dissipated the next day over Brazil , where it caused heavy rains and flooding . 112 | The New York City Housing Authority Police Department was a police department in New York City . It was started in 1952 by New York City . 113 | The band 's current band members are Flynn ( vocals , guitar ) , Duce ( bass ) , Phil Demmel ( guitar ) , and Dave McClain ( drums ) . 114 | Advocacy Countries with a minority Muslim population are more likely to be Muslim-majority countries of the Greater Middle East to use mosques as a way to promote civic participation . 115 | The characters are different from their earlier characters Pete and Dud . 116 | Johan was also the first person to play the Swedish power metal band HammerFall . The band quit before they released a studio album . 117 | In 1998 , Culver ran for Iowa Secretary of State and was made a victorious . 118 | In 1990 , Mark Messier took the Hart over Ray Bourque by two votes . The difference was a single first-place vote . 119 | Shade sets the main plot of the novel in motion when he looks like that law . He started a chain of events that leads to the destruction of his colony 's home , forcing their premature migration , and his separation from them . 120 | The female is called a daughter . 121 | He was diagnosed with inoperable cancer in April 1999 . 122 | Before the storm came to the National Park Service , the National Park Service closed places and campgrounds along the Outer Banks . 123 | The form of chess played is speed chess in which each player has a total of twelve minutes for the whole game . 124 | Amazon Basin is the part of South America . It is made up of the Amazon River and the Amazon River . 125 | The two former presidents were later charged with mutiny and treason for their roles in the 1979 coup in the 1980 Gwangju massacre . 126 | Moderate to bad damage reached the Atlantic coastline and as far as West Virginia . 127 | Because the owner is unaware , these computers are called metaphorically compared to zombies . 128 | The wave moved across the Atlantic Ocean . It became a tropical depression off the northern coast of Haiti on September 13 . 129 | For example , the stylebook of the Associated Press is updated each year . 130 | The four canonical texts are the Gospel of Matthew , Gospel of Mark , Gospel of Luke and Gospel of John , and the Gospel of John . They are probably written between AD 65 and 100 . 131 | Since the end of the 19th century , Eschelbron is well known for its large amount of money . 132 | The upper half is also the coat of arms of the former district of Oberbarnim . 133 | Unlike the clouds on Earth , however , it is made up of crystals of ice , Neptune 's clouds are made up of different crystals . 134 | Their work is usually limited until they reach legal adulthood . 135 | Development Stable releases are not common , but there are often Subversion snapshots that use enough to use . 136 | In 1482 the Order sent him to Florence , the city of his gods sent him to Florence . 137 | In the Soviet years , the Bolsheviks destroyed two of Rostov 's main cathedrals : St Alexander Nevsky Cathedral ( 1908 ) and St George Cathedral in Nakhichevan ( 1783 - 1807 ) . 138 | He died on May 29 , 1518 in Madrid , Spain . He was buried in the church of San Benito . 139 | This was shown in the Miller-Urey experiment by Stanley L . Miller and Harold C in 1953 . 140 | Cogeneration ( also combined heat and power , CHP ) is the use of a heat engine or power station . It can also be used both electricity and useful heat . 141 | However , the male '' den master '' will also allow a second male into the den ; the reason for this is not clear . 142 | A Wikipedia gadget is a JavaScript and / snippet that can be made simply by checking an option in your Wikipedia preferences . 143 | Below is some useful links to help with your involvement . 144 | He became Prime Minister of Egypt between 1945 and 1946 . He was again from 1946 to 1948 . 145 | She was left behind the island when the rest of the Nicoleños were moved to the mainland . 146 | James I became a Gentleman of the Chapel Royal in 1615 . He became an organist at least 1615 until his death . 147 | Chauvin was embarrassed to get his award and first said that he may not accept it . 148 | Later , Esperanto speakers began to see the language and the culture that had grown up around it as ends in themselves , even if Esperanto is never used by the United Nations or other international organizations . 149 | Dry air wrapping around the southern edge of the storm eroded most of the deep convection by early on September 12 . 150 | Calvin Baker is a book written by Calvin Baker . 151 | Eva Anna Paula Braun , born Eva Anna Paula Hitler ( February 6 , 1912 - April 30 , 1945 ) was the wife of Adolf Hitler . 152 | Each version of the License is given a different version number . 153 | Most IRC servers do not need users to make an account , but a user will have to set a nickname before being connected . 154 | That same year he also got a mechanics certificate . He became the youngest certificate in New York at the same time . 155 | SummerSlam ( 2009 ) is a professional wrestling pay-per-view event made by World Wrestling Entertainment ( WWE ) . It will take place on August 23 , 2009 at Staples Center in Los Angeles , California . 156 | He is usually seen as being bald , with long whiskers . He is said to be an incarnation of the Southern Polestar . 157 | A few animals have chromatic response , changing color in changing environments , either seasonally ( snowshoe hare ) or far more rapidly with chromatophores in their integument ( the cephalopod family ) . 158 | Val Venis defeated Rikishi in a Steel match to retain the WWF Intercontinental Championship ( 14 : 10 ) Venis pinned Rikishi after Tazz hit Rikishi with a TV camera . 159 | This closely looks like the Unix philosophy of having more than one program doing one thing well and working together . 160 | He came from a musical family . His mother , LaRue , was an assistant and singer , and his father Keith Brion , was a band director at the Yale University . 161 | Mennonites are in Canada , Democratic Republic of Congo and the United States . However , Mennonites can also be found in tight-knit communities in at least 51 countries on six continents of those countries . 162 | Naas is a big group of people living in Dublin . Many people living in Naas and working in Dublin . 163 | Acanthopholis ' armour was made of oval plates set almost horizontally into the skin . It also had a protruding from the neck and shoulder area , along the spine . 164 | Origin Irmo was first built on Christmas Eve in 1890 because of the opening of the Columbia , Newberry , and Laurens Railroad . 165 | It was proposed by the Law Commission . The bills start in the House of Lords in the House of Lords . 166 | In the years before his final release in 1474 , he became known as the reconquest of Wallachia . Vlad lived with his new wife in a house in the Hungarian capital . 167 | You may add a passage of up to five words as a Front-Cover Text , and a way of up to 25 words as a Back-Cover Text , to the end of the list of Cover Texts in the Modified Version . 168 | He is buried in the Restvale Cemetery in Alsip , Illinois . 169 | Bone marrow is a tissue found in the tissue that can be found in bones . 170 | Reflection nebulae are usually blue because the scattering is better for blue light than red . This is the same scattering process that gives us blue skies and red sunsets . 171 | It is found in the region Provence-Alpes-Côte dAzur in the Vaucluse department in the south of France . 172 | MacGruber starts asking for simple objects to make something to do with the bomb , but he is later distracted by something ( usually involving his personal life ) that makes him run out of time . 173 | Messiaen died , and Yvonne Loriod had the last movement of this time with advice from George Benjamin at the same time . 174 | Shi 'a Muslims consider Karbala to be one of their holiest cities after Mecca , Medina , Jerusalem and Najaf . 175 | The PAD is called for the resignation of the governments of Thaksin Shinawatra , Samak Sundaravej and Somchai Wongsawat . The PAD is thought to be a proxies for Thaksin . 176 | However travel through very remote areas , on isolated tracks , need to change planning and a good vehicle ( usually a four wheel drive ) . 177 | At Kahn he was the chief architect for the Fisher Building in 1928 . 178 | He tells him that he has to leave for rehearsal , and he and Drön leave . 179 | Britpop comes from the British independent music scene of the early 1990s . The music was started by the British guitar pop music of the 1960s and 1970s . 180 | This was made into a group of battalions being made for XI International Brigade . 181 | The Sheppard line currently has fewer users than the other two subway lines , and shorter trains are run . 182 | It has a capacity of 98,772 people . It is the largest stadium in Europe , and the second largest stadium in the world . 183 | Ten Boom was named after one of the Righteous Among the Nations by the State of Israel in 1967 . 184 | Some articles are very long and rich in content . Other articles are shorter and of lesser quality . 185 | About 95 species are currently accepted . 186 | Eugowra is said to be named after the Indigenous Australian word meaning '' the place where the sand washes down '' . 187 | Terms such as the '' Undies '' in English for underwear and '' Undies '' movie style are oft-heard terms in English . 188 | Jurisdiction is a term that comes from public international law , conflict of laws , constitutional law and the powers of the government to make the government best serve the needs of its native society . 189 | He made many other pieces about Hiawatha : The Death of Minnehaha , Overture to The Song of Hiawatha and Hiawatha 's Departure . 190 | The capital city of the state is Aracaju . 191 | Despite this , Farrenc was paid less than her male counterparts for nearly ten years . 192 | Gumbasia was created in a style of Vorkapich called Kinesthetic Film Principles . 193 | Brandon ( Waise Lee ) , became his idol , and MK Sun grew up to be a lawyer . 194 | ISBN 1 - 876429-3 is a small town near Cowra in the central west of New South Wales , Australia . It is in Cabonne Shire . 195 | Military career Donaldson joined the Australian Army on 18 June 2002 . 196 | Prospectors from California , Europe and China were also digging along the Peel River and the mountain slopes . 197 | Before the long time , it was the most commonly used calculation tool in science and engineering . 198 | The Kindle 2 features 16 - level grayscale display , improved battery life , 20 % faster page-refreshing , a text-to-speech option to read the text aloud , and thickness reduced from 0.8 to 0.36 inches ( 9.1 millimeters ) . 199 | Yoghurt , also known as yogurt , is a dairy product made by milk milk . 200 | Seventy-five defencemen are in the Hall of Fame , more than any other current position . Only 35 goaltenders have been added . 201 | Alternative views on the subject have been proposed throughout the centuries ( see below ) , but all people did not like Christians . 202 | However , the album was banned from many different countries . 203 | The legs are wide at the top , and are narrow at the top . 204 | In late 2004 , Suleman made headlines by cutting Howard Stern 's radio show from four Citadel stations . This was because he wanted to move to Sirius Satellite Radio . 205 | The company opened twice as many Canadian stores as McDonald 's Hospital Wendy 's confirms Tim Hortons IPO by the Ottawa Business Journal , December 1 , 2005 , and also sold the sales of McDonald 's Canadian company as of 2002 . 206 | Plot Captain Caleb Holt ( Kirk Cameron ) is a firefighter in Albany , Georgia . It is also known as the Cardinal rule of all firemen , who leave the partner behind him . 207 | He won the presidential election held on 2 March 2008 with 71.25 % of the popular vote . 208 | The plant is thought to be a living fossil . 209 | In 1990 , she was the only female entertainer to perform in Saudi Arabia . 210 | Stravinsky first wrote the music for writing the ballet in 1913 . 211 | Protests across the country were stopped . 212 | Offenbach 's many operettas , such as Orpheus in the Underworld , and La belle Hélène , were very popular in both France and the English-speaking world during the 1850s and 1860s . 213 | Roof dating back to the Tang Dynasty with this symbol has been found west of the ancient city of Chang 'an ( modern-day Xian ) . 214 | Jeanne Demessieux ( born Paris , 13 February 1921 ; died Paris , 11 November 1968 ) , was a French organist and composer . 215 | By most people , the instrument was nearly impossible to control . 216 | Santa Maria Maggiore ( St. Mary the Greater ) , the first church in Assisi . 217 | Characteristics Radar says that there is a fairly pure iron-nickel composition . 218 | Railway Gazette International is a monthly business journal . It is made up of the railway , metro , light rail and tram industries . 219 | He was given the Companion of Honour in 1988 . 220 | Loèche harbours include Onyx , the Swiss interception system for electronic intelligence gathering . 221 | A matchbook is a small cardboard folder ( matchcover ) inside a quantity of matches . It has a coarse on the outside . 222 | She was one of the first doctors to find out how to cigarette smoking around children , and use in pregnant women . 223 | Defiantly , she went to never renounce the Commune . She dared the judges to sentence her to death . 224 | OEL manga series Graystripe 's Trilogy There is a three first English-language manga series following Graystripe . The series was made by Twolegs in Dawn until he returned to ThunderClan in The Sight . 225 | Samovar & Porter ( 1994 ) , p. 84 Syrians did not take part in the urban area ; many of the immigrants who had worked as peddlers were able to work with Americans on a daily basis . 226 | He was also famous for his prints , book covers , posters , and garden metalwork furniture . 227 | During childhood she had pneumonia twice , and she had pneumonia 4 - 5 times a year , a ruptured appendix , and had a tonsillar cyst . 228 | Dr. David Lindenmeyer ( Australian National University ) has said that the need for nest boxes show that logging practices are not ecologically sustainable . This means that Leadbeater 's possum can be found . 229 | The Montreal Canadiens are an ice hockey team in the National Hockey League ( NHL ) . 230 | Small value inductors can also be built on integrated circuits . These are used to make transistors . 231 | The term '' gribble '' was first used for the wood-boring species , especially the first species described from Norway by Rathke in 1799 . 232 | The wounds inflicted by a club are usually known as bludgeoning or blunt-force injuries . 233 | Thereafter the county 's government was done at Duns or Lauder until Greenlaw became the county town in 1596 . 234 | No skater can be very good for a quadruple Axel in competition . 235 | From the telephone exchange , the Port Jackson District Commandant could be used to talk with all military places on the harbour . 236 | However , even to those who enter the prayer hall of a mosque without making of praying , there are still rules that use . 237 | It is described as pointed in the face and about the size of a rabbit . 238 | Computer performance is different from the amount of useful work done by a computer system compared to the time and resources used . 239 | Some of the largest lakes in the world can be found along the Volga . 240 | The crosier symbolises the monasteries of the region . 241 | Human skin can be found from very dark brown to very pale pink . 242 | Bankers from ShoreBank , a community development bank in Chicago , helped Yunus with the official bank of the Ford Foundation at the time . 243 | Bremer reported plans to put Saddam on trial . However , the details of such a trial had not yet been found . 244 | Representatives of the Professional Hockey Writers ' Association vote for the All-Star Team at the end of the season . 245 | Tajikistan , Turkmenistan and Uzbekistan borders Afghanistan to the north , Iran to the south , and the People 's Republic of China to the east . 246 | Nupedia was founded on March 9 , 2000 . It was started by Bomis , Inc. , a web portal company . 247 | Notable features of the design include key-dependent S-boxes and a very complex key schedule . 248 | Iain Grieve ( born 19 February 1987 in Jwaneng , Botswana ) is a rugby union player for the Bristol Rugby in the Guinness Premiership . 249 | Other nearby settlements include Pont-Bellanger and Beaumesnil . 250 | The first model was proposed by George Zweig in 1964 by physicists Murray Gell-Mann and George Zweig . 251 | The fourth ring was added in 1938 when the column was moved to its present location , and was added to its present location . 252 | West Berlin had its own government , separate from West Germany 's , which had its own postage stamps until 1990 . 253 | The Primavera is a painting by the Italian Renaissance painter Sandro Botticelli . 254 | New South Wales is the capital city of Sydney , Australia . 255 | Most of the time , the polymer is most often epoxy , but other polymers , such as polyester , vinyl ester , or nylon . 256 | The name survives as a brand for a series of different spin-off television channels , digital radio station , and website which have lived in the magazine . 257 | At four-and-a-half years old he was left to fend for himself on the streets of northern Italy for the next four years , living in towns with groups of other homeless children . 258 | Stands were added behind each set of goals during the 1980s and 1990s as the ground began to be more popular . 259 | A town may be described as a market town or as having market rights even if it no longer has a market , and still has the right to do so . 260 | A bastion on the eastern side was built later . 261 | Events July 29 , Battle of Stiklestad ( Norway ) : Olav Haraldsson is killed in the battle of Stiklestad , Norway . 262 | Others have said that Tresca was eliminated by the NKVD , because there was criticism of the Stalin government of the Soviet Union . 263 | This caused both Montenegro and Serbia to become an independent country . 264 | Use HTML and CSS only had a good reason and only with good reason . 265 | Schuschnigg later said that there was publicly that reports of riots were false . 266 | Addiscombe is a town in the London Borough of Croydon , England . 267 | Another closely-related meaning of constituent is that of a person living in the area governed , represented , or otherwise served by a politician ; sometimes this is used for citizens who elected the politician . 268 | Prunk is a member of Institute of European History in Mainz . He was also a member of the Center for European Integration Studies in Bonn . 269 | Stallone also had a cameo appearance in the 2003 French film Taxi 3 as a passenger . 270 | Instead , the crew said that a trailer had a trailer with a ship called a '' cantilevered arm '' . They shot the scene while riding up Templin Highway north of Santa Clarita . 271 | The conference is based on the next year in a bookMicroeconomic Foundations of Employment and Inflation Theory by Phelps et al . 272 | Wario Land The Wario Land series is a series of video games that started with Wario Land : Super Mario Land 3 and Super Mario Land 3 . 273 | Chopin 's Opus 57 , Frédéric Chopin , is a piano player . 274 | These attacks may have been different in origin rather than physical . 275 | A historian has said that he was quinine 's efficacy . He said that he gave some opportunities to swarm into the Gold Coast , Nigeria and other parts of west Africa . 276 | Because of this , spectroscopic studies have shown evidence of hydrated minerals and silicates , which show a stony surface . 277 | She became the editor of her husband 's works for Breitkopf und Härtel . 278 | Mercury is similar in appearance to the Moon . It is very similar to regions of smooth plains , and has no moons and no big atmosphere . 279 | Geography The town is located in the Limmat valley between Baden and Zürich . 280 | These include good habitat for chinkara , hog deer and blue bull . 281 | After the Sena dynasty , Dhaka was ruled by the Turkish and Afghan governors from the Delhi Sultanate before the Mughals arrived in 1608 . 282 | The Prime Minister stays in office only as long as he or she has the support of the lower house . 283 | For Rowling , this scene is important because it shows Harry 's bravery , and Cedric 's corpse , he shows selflessness and compassion . 284 | On June 1 , 1972 , he and fellow RAF members Jan-Carl Raspe and Holger Meins were killed when they were shootout in Frankfurt . 285 | Together they formed New Music Manchester , a group made up of modern music . 286 | Hurricane Mitch caused extreme damage in the upper Florida Keys , as a storm surge of about 18 to 20 feet affected the region . 287 | It is now the site of Meher Baba 's samadhi ( tomb-shrine ) as well as places where people live . 288 | The collapsed dome of the main church has been taken over by the church . 289 | In 2005 , Meissner became the second American woman to get the first Axel jump in national competition . 290 | Salem is a city in the state of Massachusetts in the United States . 291 | Forty-nine species of pipefish and nine species of seahorse have been found . 292 | Saint Martin is a tropical island in the northeast Caribbean , about 300 km east of Puerto Rico . 293 | However , these PDFs can not be found without further manipulation if they have images . 294 | In April 1862 , Ben was arrested on the orders of Police Inspector Sir Frederick Pottinger . He took part in the company of Frank Gardiner in the police . 295 | Heavy rain fell across parts of Britain on October 5 . This caused flood water to flood the waters . 296 | Version 2009.1 provides a USB installer to create a Live USB , where the user 's configuration and personal data can be saved if wanted . 297 | In this case , there were two members , Christian Democratic People 's Party ( CVP ) : 2 members , Social Democratic Party ( SP ) : 2 members , Swiss People 's Party ( SVP ) : 2 members , Social Democratic Party ( SP ) : 2 members , and Swiss People 's Party ( SVP ) : 1 member . 298 | A fee is the price one pays for services , especially the honorarium paid to a doctor , lawyer , consultant , or other member of the government . 299 | Ohio State 's library system includes twenty-one libraries located in the city of Columbus . 300 | In other developments , both Iceland and Greenland said that there was the overlordship of Norway , but Scotland was able to make a Norse invasion . 301 | The singles from the album were '' In the Way Distribution '' , '' Distribution '' , '' Distribution '' , '' Stop '' and '' Universally Speaking '' . 302 | In April 2000 , MINIX became free / open source software under a permissive free software licence , but by this time other operating systems had become more important than the operating system for students and hobbyists . 303 | The body color varies from medium brown to gold-ish to beige-white . The color sometimes has dark brown spots , especially on the limbs . 304 | The Britannica was mostly a Scottish company . It was used by its thistle logo , the emblem of Scotland . 305 | The area covered by the warning was extended southwards as Jose strengthened , before being canceled soon after landfall on September 23 . 306 | In August 2003 , the San Diego Union Tribune said that U . Marine pilots and their commanders used Mark 77 firebombs on Iraqi Republican Guards during the first time of the war . 307 | The latter gave audiences with the sort of information later given by intertitles , and can help historians imagine what the film may have been like . 308 | That is because real estate , businesses and other things in the underground city of economies of the Third World can not be used as well as making money industrial and commercial expansion . 309 | He moved from Sydney Cove several times before being shot dead in 1796 . 310 | Ned and Dan went back to the police camp . They ordered them to surrender . 311 | Before the second game got underway , the press agreed that the using midget-in-a-cake 's standard had not been up to Veeck 's current standard . 312 | In a short video promoting the charity Equality Now Joss Whedon said that the movie was not done , Fray is coming back . 313 | A mutant is a fictional character in a comic book , published by marvel comics . 314 | The SAT Reasoning Test ( used to be called Scholastic Aptitude Test and Scholastic Assessment Test ) is a test for college admissions in the United States . 315 | Civil unrest in northern Italy has the medieval musical form of Geisslerlieder . The songs were sung by bands of Flagellants . 316 | Some reports read that different things make up the likelihood of both paralysis and hallucinations . 317 | He went to Australia for seven years to travel for seven years . 318 | Waugh writes that Charles had been styled in search of love in those days , when he first met Sebastian , found out that low door in the wall had been in search of love in those days . This was a metaphor that tells the work on a number of levels . 319 | Her friendship with the Russian mystic Grigori Rasputin was also an important factor in her life . 320 | The term dorsal means anatomical structures that are either found in or grow off that side of an animal . 321 | The term '' excavation '' was first used by Berzelius , after Mulder found that all proteins seemed to have the same formula , and might be made of a single type of molecule ( very large ) . 322 | After the Jerilderie raid , the gang moved to the city for 16 months . 323 | It is found in the region Basse-Normandie in the Calvados department in the northwest of France . 324 | Color can be found from orange to pale yellow . 325 | In 1963 an extension was added , with the north from Union station to the station , below University Avenue and Queen 's Park to near Bloor Street , where it turned west to end at St. George and Bloor Streets . 326 | Before 1980 , a part of the Commonwealth Railways Central Australian Line passed along the western side of the Simpson Desert . 327 | It is located on an old portage trail . It led west through the mountains to Unalakleet . 328 | People with cardiomyopathy often have a risk of heart cardiac death or both . 329 | As the largest sub-region in Mesoamerica , it became a very big and varied landscape , from the mountainous regions of the Sierra Madre to the plains of northern Yucatán . 330 | Google then made the comic available on Google Books and mentioned it on its official blog along with the early release of Google . 331 | Anyone may register a pedigree with the college , where they are carefully audited and need official proofs before being changed . 332 | The book , Political Economy , was published in 1985 , but it was not published until 1985 . 333 | He toured with the IPO in the spring of 1990 for their first-ever performance in the Soviet Union , with concerts in Moscow and Leningrad , and toured with the IPO again in 1994 , performing in China and India . 334 | Napoleonic Wars : Austrian General Mack surrenders his army to the Grand Army of Napoleon at Ulm . This was because Napoleon over 30,000 prisoners had to lose 10,000 people . 335 | The city has long been the economic centre of northern Nigeria , and a center for the production of groundnuts . 336 | Most of South Indians speak one of the five Dravidian languages , the Malayalam , Tamil , Telugu , Telugu , and Tulu . 337 | Meteora also won many awards and honors . 338 | After a short time , the WWF cavalry turned around and attacked Kane and Jericho . 339 | Most of the songs were written by Richard M. Sherman and Robert B. Sherman . 340 | In the 5th century Slavs started to move into the area . 341 | From 1900 to 1920 many new facilities were built on campus , including buildings for the dental and pharmacy programs , a chemistry building for the natural sciences , Hill Auditorium , large hospital and library complexes , and two home halls . 342 | Winchester is a city of Illinois in the United States . 343 | Name Arzashkun seems to be the Assyrian form of an Armenian name ending in -ka . This name comes from Arzashkun , which means Arsene , Arsissa by the ancients to part of Lake Van . 344 | Out of 16,421 people living in the national casting , she was chosen among the 15 people to appear on the TV show . 345 | Its episodes were shown on the ABC network from September 21 , 1993 to March 1 , 2005 . 346 | The device can then be made and used as a source of environments . 347 | Gimnasia hired first success with Colombian trainer Francisco Maturana , and then Julio César Falcioni , but both had very little success . 348 | Brighton is a city of Iowa in the United States . 349 | She also appeared in several music videos , including '' Cap It Girl '' by John Oates and '' Land Just Lose It '' by Eminem . 350 | On June 24 1979 , on the 750th anniversary of the village , Glinde became a town . 351 | Pauline went back in the Game Boy remake of Donkey Kong in 1994 , and later Mario vs. Donkey Kong 2 : March of the Minis in 2006 . However , the character is now described as the new character in the series . 352 | The vagina is very elastic and stretches to many times its normal diameter during a vaginal birth . 353 | His real date of birth was never recorded , but it is thought to be between 1935 and 1939 . 354 | This measure indicates how much of a particular drug or other substance ( inhibitor ) is needed to make a given biological process ( or part of a process , i.e. an enzyme , cell receptor or microorganism ) by half . 355 | Although the name suggests that they are located in the Bernese Oberland region of the canton of Bern , parts of the Bernese Alps are next to Valais , Lucerne , Obwalden , Fribourg and Vaud . 356 | There he had one daughter , Mary Ann Fisher Power , who was later married to Ann ( e ) Power . 357 | During an interview , Edward Gorey said that Bawden was one of his favorite artists . He said that not many people remembered or knew about this best artist . 358 | The string can make different notes in different modes just as a guitar string can produce different notes . Each string appears as a different particle : electron , photon , gluon . 359 | Gable also won an Academy Award nomination when he played Fletcher Christian in 1935 's Mutiny on the Bounty . 360 | --------------------------------------------------------------------------------