├── LICENSE ├── README.md ├── img ├── hist-example.png ├── qq-manual-example.png ├── qq-plot-example.png ├── qq-plot-skewed-example.png ├── regression-example.png ├── residuals-example.png ├── sentiment-contributions.png ├── sentiment-labels.png └── sentiment-positivity.png ├── info.rkt ├── lexicons ├── AFINN-lexicon ├── SMART-stopwords ├── bing-lexicon ├── nrc-lexicon ├── onix-stopwords └── snowball-stopwords └── main.rkt /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Data Science Tooling For Racket 2 | 3 | This project is a work in progress. Documented functions are working, however, and you are welcome to snoop around. Eventually, this will evolve into a package of convenience functions for data science: data cleaning, wrangling, summarizing, and exploration. 4 | 5 | Many functions contained within are inspired by functionality commonly available in more statistically-oriented software packages such as R, numpy/scipy, and Matlab/Octave. This all began because I wanted the R function `aggregate` in Racket. 6 | 7 | # Table of Contents 8 | 9 | - [Installation](#installation) 10 | - [Data Import/Export](#importexport) 11 | - [CSV Reading](#read-csv) 12 | - [CSV Writing](#write-csv) 13 | - [Split -> Apply -> Combine Workflows](#split-apply-combine) 14 | - [Column Indexing](#-column-indexing) 15 | - [Aggregate](#aggregate) 16 | - [Grouping Data](#group-with) 17 | - [Counting Samples](#sorted-counts) 18 | - [Subsetting Data](#subset) 19 | - [Statistical Utilities](#general-utilities) 20 | - [Logarithms](#log-base-logarithms-with-arbitrary-base) 21 | - [Singular Value Decomposition](#singular-value-decomposition-1-dimensional) 22 | - [Data scaling: Z-transformation](#z-transform-data-scale) 23 | - [Statistical Tests/Models](#statistical-tests-and-models) 24 | - [Linear Regression Models](#linear-model) 25 | - [Chi-Square Goodness of Fit Test](#chi-square-goodness) 26 | - [Text Processing](#text-processing) 27 | - [URL Removal](#remove-urls) 28 | - [Punctuation Removal](#remove-punctuation) 29 | - [Stop-word Removal](#remove-stopwords) 30 | - [n-gram Extraction](#n-gram) 31 | - [Tokenizing Documents](#document-tokens) 32 | - [Document Term Matrix](#dtm) 33 | - [Term Document Matrix](#tdm) 34 | - [Cosine Similarity](#cosine-similarity) 35 | - [Sentiment Analysis](#sentiment-analysis) 36 | - [Token/word sentiment](#token-sentiment) 37 | - [Document Sentiment](#list-sentiment) 38 | - [Plotting Utilities](#plotting-functions) 39 | - [Frequency Histograms](#histogram-of-sorted-counts) 40 | - [Quantile-Quantile (Q-Q) Plot](#quantile-quantile-q-q-plot) 41 | - [Bugs and Improvements](#bugs--improvements) 42 | - [License](#license) 43 | 44 | ## Installation 45 | The data-science package is not currently registered in Racket's package catalog. It can, however, be installed directly from GitHub via raco: 46 | 47 | ``` racket 48 | raco pkg install https://github.com/n3mo/data-science.git 49 | ``` 50 | 51 | # Usage 52 | 53 | ## Import/Export 54 | 55 | ### read-CSV 56 | 57 | ```racket 58 | (read-csv file-path [#:->number? #f 59 | #:header? #t]) 60 | ``` 61 | 62 | Convenience wrapper around `csv->list` and `make-csv-reader` from the *csv-reading* package. Reads a comma-separated-values file located at `file-path`, ignoring lines beginning with the # character. If *#:->number* is #t, `read-csv` attempts to convert the data to numbers, otherwise everything is treated as strings. When *#:header?* is #t, the first line in the input file is assumed to contain column names. 63 | 64 | Example: 65 | 66 | ```racket 67 | ;;; Read a data file, converting to numeric data type 68 | (define data (read-csv "./my_data_file.csv" #:->number? #t)) 69 | ``` 70 | 71 | ### write-CSV 72 | 73 | ```racket 74 | (write-csv lst file-path [#:delimeter #\,]) 75 | ``` 76 | 77 | Writes a list-of-lists to file-path as comma-separated-values. The default delimeter is a comma. 78 | 79 | Example: 80 | 81 | ```racket 82 | (define my-data '(("ship" "anticipation" 518) 83 | ("sea" "positive" 455) 84 | ("long" "anticipation" 334) 85 | ("time" "anticipation" 334) 86 | ("captain" "positive" 329))) 87 | 88 | (write-csv my-data "./data-results.csv") 89 | ``` 90 | 91 | ## Split->Apply->Combine 92 | `data-science` provides a collection of ultility functions for breaking your data into meaningful pieces, applying functions to each piece, and then recombining the results. In fact, the filter/map/apply approach of lisp-like languages is well suited to such tasks. However, with complex analyses, commands can grow quite complex and cumbersome, and can mask their intended purpose. The following functions provide convenient short-hand procedures that aim to be *expressive, yet concise*. 93 | 94 | ### $ (Column-indexing) 95 | 96 | ``` racket 97 | ($ lst index) 98 | ``` 99 | 100 | Returns a "column" of data from a list-of-lists *lst*. Column selection is controlled by *index,* which can be either a number or a symbol. If *index* is a number, the corresponding column is returned from all rows of *lst*. If *index* is a symbol, then the first row of *lst* is assumed to be a header containing named fields of each column. In this situation, $ returns the corresponding column of data identified by the column name, *excluding the first row*--that is, the header name is **not** part of the return value. 101 | 102 | Examples: 103 | 104 | ``` racket 105 | ;;; Numerical indexing 106 | (define my-data '((1 2 3) 107 | (4 5 6) 108 | (7 8 9) 109 | (10 11 12))) 110 | ($ my-data 0) 111 | ;; --> '(1 4 7 10) 112 | 113 | ;;; Indexing by name 114 | (define my-data '((age rank id) 115 | (21 1 100) 116 | (18 2 101) 117 | (32 1 102) 118 | (19 4 103))) 119 | ($ my-data 'rank) 120 | ;; --> '(1 2 1 4) 121 | ``` 122 | 123 | ### Aggregate 124 | 125 | ```racket 126 | (aggregate f factors lst) 127 | ``` 128 | 129 | `aggregate` applies function `f` to the elements of `lst`, as grouped by `factors`. Essentially, `aggregate` groups the data using the function `group-with` (see documentation for full details), and applies the function `f` to each grouping. 130 | 131 | Examples: 132 | 133 | ```racket 134 | ;;; A little help from the math module 135 | (require math) 136 | 137 | ;;; Say that we have responses from two experimental conditions, 138 | ;;; "A" and "B," and we want to know about these two groups separately. 139 | 140 | ;;; Our condition factors 141 | (define condition '(A A A B B B B B B A A)) 142 | 143 | ;;; Our response data 144 | (define response '(3 5 5 1 2 1 4 7 3 8 3)) 145 | 146 | ;;; How many observations from each condition? 147 | (aggregate length condition response) 148 | ;; --> '((A 5) (B 6)) 149 | 150 | ;;; What's the mean response from each condition? 151 | (aggregate mean condition response) 152 | ;; --> '((A 24/5) (B 3)) 153 | 154 | ;;; Let's add 1 to each response from each condition 155 | (aggregate (λ (x) (map add1 x)) condition response) 156 | ;; --> '((A (4 6 6 9 4)) (B (2 3 2 5 8 4))) 157 | ``` 158 | 159 | ### Group-With 160 | 161 | ```racket 162 | (group-with factors lst [include-factors? #t]) 163 | ``` 164 | 165 | Similar to `group-by`, but accepts two *ordered* lists: `factors` and `lst`. The elements of `lst` are grouped into sub-lists according to the grouping factors in `factors`. Returns a list of lists, with one list per element in `factors`. If *include-factors?* is #t, the grouping element from `factors` is included first in each sub-list, enabling the returned lists to be accessed as an associate list. 166 | 167 | Examples: 168 | 169 | ```racket 170 | (group-with '(A B A B A B A B) '(1 2 3 4 5 6 7 8)) 171 | ;; --> '((A 1 3 5 7) (B 2 4 6 8)) 172 | 173 | ;;; Or, with no factors returned: 174 | (group-with '(A B A B A B A B) '(1 2 3 4 5 6 7 8) #f) 175 | ;; --> '((1 3 5 7) (2 4 6 8)) 176 | ``` 177 | 178 | ### Sorted-Counts 179 | 180 | ```racket 181 | (sorted-counts lst) 182 | ``` 183 | 184 | Data in `lst` are counted and sorted into a list of observed frequencies. Returns a list-of-lists suitable for passing to `discrete-histogram`. In fact, `hist` and `hist*` call `sorted-counts` to tabulate data prior to plotting. 185 | 186 | ### Subset 187 | 188 | ```racket 189 | (subset lst index f) 190 | ``` 191 | 192 | Returns (filters) a subset of data from a list-of-lists *lst*. Column selection is controlled by *index,* which can be either a number or a symbol. If *index* is a number, data from the corresponding column is used. If *index* is a symbol, then the first row of *lst* is assumed to be a header containing named fields of each column. In this situation, data from the corresponding column of data identified by the column name is used, *excluding the first row*--that is, the header row is not subjected to filtering, and is returned un-touched as part of the returned subset. In either case, the values from the indexed column are filtered via *f*, which is either a 1-parameter function that must return a boolean value, or a string, symbol, or number, in which case filtering is completed with `(λ (x) (equal? x f))`. The returned value is a list-of-lists wherein the values in column *index* are #t according to *f*. 193 | 194 | Examples: 195 | 196 | ```racket 197 | ;;; Sleep data involving the effect of two drugs on 10 198 | ;;; participant's sleep. Data taken from: 199 | ;;; Cushny, A. R. and Peebles, A. R. (1905) The action of optical 200 | ;;; isomers: II hyoscines. The Journal of Physiology 32, 501-510. 201 | (define sleep '((extra group ID) 202 | (0.7 1 1) 203 | (-1.6 1 2) 204 | (-0.2 1 3) 205 | (-1.2 1 4) 206 | (-0.1 1 5) 207 | (3.4 1 6) 208 | (3.7 1 7) 209 | (0.8 1 8) 210 | (0.0 1 9) 211 | (2.0 1 10) 212 | (1.9 2 1) 213 | (0.8 2 2) 214 | (1.1 2 3) 215 | (0.1 2 4) 216 | (-0.1 2 5) 217 | (4.4 2 6) 218 | (5.5 2 7) 219 | (1.6 2 8) 220 | (4.6 2 9) 221 | (3.4 2 10))) 222 | 223 | ;;; If we only want to look at data from group 1 (drug #1), we can 224 | ;;; subset that portion of the data set out. 225 | (subset sleep 'group 1) 226 | ;;; Equivalently: (subset sleep 'group (λ (x) (equal? x 1))) 227 | ;; --> '((extra group ID) 228 | (0.7 1 1) 229 | (-1.6 1 2) 230 | (-0.2 1 3) 231 | (-1.2 1 4) 232 | (-0.1 1 5) 233 | (3.4 1 6) 234 | (3.7 1 7) 235 | (0.8 1 8) 236 | (0.0 1 9) 237 | (2.0 1 10)) 238 | 239 | ;;; Combined with the `$` function, we can easily calculate the 240 | ;;; mean change in sleep for cond 1 241 | (mean ($ (subset sleep 'group 1) 'extra)) 242 | ;;; Equivalently: (mean ($ (subset sleep 'group (λ (x) (equal? x 1))) 'extra)) 243 | ;; --> 0.75 244 | 245 | ;;; Of course, for common practices such as the above example, 246 | ;;; consider using the `aggregate` function: 247 | (aggregate mean ($ sleep 'group) ($ sleep 'extra)) 248 | ;; --> '((1 0.75) (2 2.33)) 249 | ``` 250 | 251 | 252 | ## General Utilities 253 | 254 | ### log-base (Logarithms with arbitrary base) 255 | 256 | ```racket 257 | (log-base n #:base [base (exp 1)]) 258 | ``` 259 | 260 | Returns the logarithm of `n`. The base can be set with `#:base` 261 | 262 | Examples: 263 | 264 | ```racket 265 | ;;; Same as the log function from racket/base 266 | (log-base 10) 267 | ;;; --> 2.302585092994046 268 | 269 | ;;; Compute a base-10 logarithm 270 | (log-base 10 #:base 10) 271 | ;;; --> 1.0 272 | 273 | ``` 274 | 275 | ### Singular Value Decomposition (1-Dimensional) 276 | 277 | ```racket 278 | (svd-1d A [epsilon 1e-10]) 279 | ``` 280 | 281 | Estimates the 1-dimensional singular value decomposition for matrix *A*, stopping when the magnitude between the current and previous estimates (i.e., the cosine of the angle between them) is close to 1 (1 - *epsilon*). `svd-1d` uses the "Power Method" and so can take a long time to converge when the ratio between singular values is close to 1. 282 | 283 | Example: 284 | 285 | ```racket 286 | ;;; Some data 287 | (define my-matrix (matrix [[2 5 3] 288 | [1 2 1] 289 | [4 1 1] 290 | [3 5 2] 291 | [5 3 1] 292 | [4 5 5] 293 | [2 4 2] 294 | [2 2 5]])) 295 | 296 | (svd-1d my-matrix) 297 | ;; --> (array #[#[-0.5418477730068635] #[-0.6707099886151974] #[-0.5065067640805049]]) 298 | ``` 299 | 300 | ### z-transform data (Scale) 301 | 302 | ```racket 303 | (scale lst) 304 | ``` 305 | 306 | Scales (via z-transformation) the data in `lst` such that `(mean lst) --> 0` and `(stddev lst) --> 1` 307 | 308 | Example: 309 | 310 | ```racket 311 | (scale '(6 2 4 19 3 6)) 312 | 313 | ;; --> '(-0.1168412475673972 314 | ;; -0.8178887329717804 315 | ;; -0.4673649902695888 316 | ;; 2.1615630799968484 317 | ;; -0.6426268616206846 318 | ;; -0.1168412475673972) 319 | ``` 320 | 321 | ## Statistical Tests and Models 322 | A host of statistical tests and models will be supported, including things such as multiple linear regression, t tests, chi-squared tests, ANOVAs, etc. 323 | 324 | ### Linear Model 325 | 326 | ``` racket 327 | (linear-model xs ys) 328 | ``` 329 | ``` racket 330 | (linear-model* xs ys) 331 | ``` 332 | 333 | Estimates simple and multiple linear regression for independent variable(s) *xs* and dependent variable *y*. For simple linear regression, *xs* should be a single list of observations. For multiple regression, *xs* should be a list-of-lists containing independent variables arranged by "columns". Observed values of the dependent variable should be passed as *y*. 334 | 335 | `linear-model` returns a list containing `'(intercept coefficient ...)`, with one coefficient for every independent (predictor) variable in *xs*. 336 | 337 | `linear-model*` returns a hash with the following fields 338 | - **X** --> Design matrix 339 | - **Y** --> Response vector 340 | - **coef** --> a list containing `'(intercept coefficient ...)`, with one coefficient for every independent (predictor) variable in *xs* 341 | - **residuals** --> (Y-Xβ) as a list 342 | - **n** --> sample size 343 | - **p** --> number of predictors 344 | - **mse** --> mean squared error 345 | - **root-mse** --> root mean squared error 346 | 347 | Example: Simple Linear Regression 348 | 349 | ``` racket 350 | (require math) 351 | 352 | ;;; Independent variable 353 | (define xs (range 100)) 354 | 355 | ;;; Generate some noisy dependent variable data with a given 356 | ;;; intercept and slope 357 | (define intercept 4.83) 358 | (define slope 1.27) 359 | (define ys (map + (map (λ (x) (+ (* x slope) intercept)) xs) 360 | (sample (normal-dist 0 30) 100))) 361 | 362 | 363 | ;;; Try to recover the original coefficients (intercept slope) 364 | (linear-model xs ys) 365 | 366 | ;; Results are pretty close given the noise 367 | ;; --> '(0.3148930686704432 1.2717819785002806) 368 | 369 | ;;; Plot the raw data and the model 370 | (require plot) 371 | (let* ([coef (linear-model xs ys)] 372 | [slope (cadr coef)] 373 | [intercept (car coef)]) 374 | (plot (list (points (map vector xs ys)) 375 | (function (λ (x) (+ (* x slope) intercept)))))) 376 | ``` 377 | 378 | ![Model Fit](https://github.com/n3mo/data-science/raw/master/img/regression-example.png) 379 | 380 | For a more thorough analysis, it can be more useful to store the full model results as a hash using `linear-model*` and then work from there: 381 | 382 | ```racket 383 | ;;; Using the same data from the previous example 384 | 385 | ;;; Fit the model and store the full results 386 | (define fit (linear-model* xs ys)) 387 | 388 | ;;; Let's inspect the coefficients 389 | (hash-ref fit 'coef) 390 | 391 | ;;; Using the `qq-plot` functions, we can inspect the residuals to 392 | ;;; ensure normality 393 | (qq-plot* (hash-ref fit 'residuals)) 394 | ``` 395 | 396 | ![Model Fit](https://github.com/n3mo/data-science/raw/master/img/residuals-example.png) 397 | 398 | Example: Multiple Linear Regression 399 | 400 | ``` racket 401 | ;;; First independent variable 402 | (define x1 '(52 59 67 73 64 74 54 61 65 46 72)) 403 | ;;; Second independent variable 404 | (define x2 '(173 184 194 211 196 220 188 188 207 167 217)) 405 | ;;; Dependent variable 406 | (define y '(132 143 153 162 154 168 137 149 159 128 166)) 407 | ;;; Fit the model 408 | (linear-model (map list x1 x2) y) 409 | 410 | ;; --> '(89144774/2876185 2477588/2876185 963117/2876185) 411 | ``` 412 | 413 | Example: Multiple Linear Regression With Interactions. Individual predictors represent main effects. The interaction between predictors is their product 414 | 415 | ``` racket 416 | ;;; First independent variable 417 | (define x1 '(52 59 67 73 64 74 54 61 65 46 72)) 418 | ;;; Second independent variable 419 | (define x2 '(173 184 194 211 196 220 188 188 207 167 217)) 420 | ;;; The interaction of x1 and x2 is their product 421 | (define interaction (map * x1 x2)) 422 | ;;; Dependent variable 423 | (define y '(132 143 153 162 154 168 137 149 159 128 166)) 424 | ;;; Fit the model 425 | (linear-model (map list x1 x2 interaction) y) 426 | 427 | ;; --> '(1054612228677/92932149757 106305446023/92932149757 41389810584/92932149757 -295039649/185864299514) 428 | 429 | ;;; Let's see the approximate decimal values 430 | (map exact->inexact (linear-model (map list x1 x2 interaction) y)) 431 | 432 | ;; --> '(11.348195769005791 1.1439038728897226 0.4453766612762809 -0.0015873927901779573) 433 | 434 | ``` 435 | 436 | ### chi-square-goodness 437 | 438 | ```racket 439 | (chi-square-goodness lst p #:alpha [alpha 0.05]) 440 | ``` 441 | 442 | Chi-square goodness of fit test. `lst` should contain variables and observered frequencies as a list of lists. `p` should be a list of hypothesized probabilities, one for each variable in `lst`. The alpha level (default 0.05) can be optionally set. 443 | 444 | Example: 445 | 446 | ```racket 447 | ;;; Some count data 448 | (define counts '(("yes" 2700) ("no" 2793))) 449 | 450 | ;;; For this test, we assume equal probabilities (i.e., we expect 451 | ;;; equal "yes" vs "no" responses. 452 | (chi-square-goodness counts '(0.5 0.5)) 453 | ;;; --> '#hash(('df . 1) 454 | ;;; ('criterion . 3.8414588206941254) 455 | ;;; ('result . "not-significant") 456 | ;;; ('alpha . 0.05) 457 | ;;; ('chisqr . 1.5745494265428728)) 458 | ``` 459 | 460 | ## Text Processing 461 | 462 | ### remove-urls 463 | 464 | ```racket 465 | (remove-urls str) 466 | ``` 467 | 468 | Returns a copy string `str` with URLs removed. 469 | 470 | Examples: 471 | 472 | ```racket 473 | (remove-urls "This works for regular http://www.example.com and secure urls https://www.example.com") 474 | ;;; --> "This works for regular and secure urls " 475 | ``` 476 | 477 | ### remove-punctuation 478 | 479 | ```racket 480 | (remove-punctuation str #:websafe? [websafe? #f]) 481 | ``` 482 | 483 | Returns a copy of string `str` with punctuation removed. If websafe? is #t, meaningful web punctuation such as #hashtags and @usernames are untouched. 484 | 485 | Examples: 486 | 487 | ```racket 488 | (remove-punctuation "hey, this sentence-which is great-has too; much punctuation!.?") 489 | ;;; --> "hey this sentence which is great has too much punctuation " 490 | 491 | ;;; Clean up punctuation without removing hashtag and username info 492 | (remove-punctuation "clean, this up... but keep #hashtag1 and #hashtag2, along with the @user name!" #:websafe? #t) 493 | ;; --> "clean this up but keep #hashtag1 and #hashtag2 along with the @user name" 494 | ``` 495 | 496 | ### remove-stopwords 497 | 498 | ```racket 499 | (remove-stopwords lst #:lexicon [lexicon 'SMART]) 500 | ``` 501 | 502 | Returns a copy of list `lst`, as returned by `document->tokens,` with stopwords removed. `#:lexicon` can be the symbols: 503 | 504 | - SMART --> Uses the SMART stop-word lexicon 505 | - snowball --> Uses the snowball stop-word lexicon 506 | - onix --> Uses the onix stop-word lexicon 507 | 508 | Examples: 509 | 510 | ```racket 511 | ;;; Default lexicon (SMART) 512 | (define text "this is a story about technology and the negative effects that technology can have on our world") 513 | (define words (document->tokens text #:sort? #t)) 514 | (remove-stopwords words) 515 | ;;; --> '(("technology" 2) ("story" 1) ("negative" 1) ("effects" 1) ("world" 1)) 516 | 517 | ;;; Using a different lexicon 518 | (remove-stopwords words #:lexicon 'snowball) 519 | ;;; --> '(("technology" 2) 520 | ;;; ("story" 1) 521 | ;;; ("negative" 1) 522 | ;;; ("effects" 1) 523 | ;;; ("can" 1) 524 | ;;; ("world" 1)) 525 | 526 | ``` 527 | 528 | ### n-gram 529 | 530 | ```racket 531 | (n-gram str n) 532 | ``` 533 | 534 | Returns a list of all possible n-grams of size `n` (for any `n` greater than zero) in string `str`. If `n` is greater than `(string-length str)` then '() is returned. 535 | 536 | Examples: 537 | 538 | ```racket 539 | ;;; Return all unigrams from a string 540 | (n-gram "what a time to be alive" 1) 541 | ;;; --> '(("what") ("a") ("time") ("to") ("be") ("alive")) 542 | 543 | ;;; Return all bigrams from a string 544 | (n-gram "what a time to be alive" 2) 545 | ;;; --> '(("what" "a") ("a" "time") ("time" "to") ("to" "be") ("be" "alive")) 546 | 547 | ;;; Return all trigrams from a string 548 | (n-gram "what a time to be alive" 3) 549 | ;;; --> '(("what" "a" "time") 550 | ;;; ("a" "time" "to") 551 | ;;; ("time" "to" "be") 552 | ;;; ("to" "be" "alive")) 553 | 554 | ;;; etc. for all n-grams 555 | ``` 556 | 557 | ### document->tokens 558 | 559 | ```racket 560 | (document->tokens str [#:sort? #f]) 561 | ``` 562 | 563 | For string `str`, returns a list of pairs. Each pair consists of a unique word/token from `str` with its frequency. 564 | 565 | Examples: 566 | 567 | ```racket 568 | (document->tokens "there there are are two two of of everything everything except except this") 569 | ;;; --> '(("there" 2) 570 | ;;; ("are" 2) 571 | ;;; ("two" 2) 572 | ;;; ("of" 2) 573 | ;;; ("everything" 2) 574 | ;;; ("except" 2) 575 | ;;; ("this" 1)) 576 | ``` 577 | 578 | ### dtm 579 | 580 | ```racket 581 | (dtm . corpus) 582 | ``` 583 | 584 | Calculates a document-term-matrix for the text in `corpus` (wherein matrix rows correspond to documents and columns to individual words/tokens). More specifically, the **term frequency-inverse document frequency** (tf-idf) matrix is returned. `corpus` should be one or more values as returned by `document->tokens`. The racket/math matrix is returned in a list along with a list of words/tokens found across all documents. The order of the list of tokens corresponds to the columns in the returned dtm. This is the same as the `tdm` function--the returned matrix is simply the transpose of that returned by `tdm`. 585 | 586 | Examples: 587 | 588 | ```racket 589 | ;;; Two simple documents 590 | (define doc1 "this is a a sample") 591 | (define doc2 "this is another another example example example") 592 | 593 | ;;; Convert each document to a list of term frequencies, passing both 594 | ;;; to dtm 595 | (dtm (document->tokens doc1) 596 | (document->tokens doc2)) 597 | ;; (list 598 | ;; '("sample" "this" "is" "a" "another" "example") 599 | ;; (array 600 | ;; #[#[0.06020599913279623 0 0 0.12041199826559246 0 0] 601 | ;; #[0 0 0 0 0.0860085701897089 0.12901285528456333]])) 602 | ``` 603 | ### tdm 604 | 605 | ```racket 606 | (tdm . corpus) 607 | ``` 608 | 609 | Calculates a term-document-matrix for the text in `corpus` (wherein matrix rows correspond to words/tokens and columns to individual documents). More specifically, the **term frequency-inverse document frequency** (tf-idf) matrix is returned. `corpus` should be one or more values as returned by `document->tokens`. The racket/math matrix is returned in a list along with a list of words/tokens found across all documents. The order of the list of tokens corresponds to the rows in the returned tdm. This is the same as the `dtm` function--the returned matrix is simply the transpose of that returned by `dtm`. 610 | 611 | Examples: 612 | 613 | ```racket 614 | ;;; Two simple documents 615 | (define doc1 "this is a a sample") 616 | (define doc2 "this is another another example example example") 617 | 618 | ;;; Convert each document to a list of term frequencies, passing both 619 | ;;; to tdm 620 | (tdm (document->tokens doc1) 621 | (document->tokens doc2)) 622 | ;; (list 623 | ;; '("sample" "this" "is" "a" "another" "example") 624 | ;; (array 625 | ;; #[#[0.06020599913279623 0] 626 | ;; #[0 0] 627 | ;; #[0 0] 628 | ;; #[0.12041199826559246 0] 629 | ;; #[0 0.0860085701897089] 630 | ;; #[0 0.12901285528456333]])) 631 | ``` 632 | 633 | ### cosine-similarity 634 | 635 | ```racket 636 | (cosine-similarity v1 v2) 637 | ``` 638 | 639 | Returns the cosine similarity for matrices v1 and v2. 640 | 641 | Example: 642 | 643 | ```racket 644 | ;;; Create two vectors 645 | (define v1 (row-matrix [5 0 3 0 2 0 0 2 0 0])) 646 | (define v2 (row-matrix [3 0 2 0 1 1 0 1 0 1])) 647 | 648 | ;;; Similarity 649 | (cosine-similarity v1 v2) 650 | ;; --> 0.9356014857063997 651 | ``` 652 | 653 | ## Sentiment Analysis 654 | 655 | Sentiment analysis is commonly used to quickly determine the mood, or emotional valence of a body of text. The `data-science` package offers sentiment analysis via three different lexicons 656 | 657 | - nrc lexicon 658 | - bing lexicon 659 | - AFINN lexicon 660 | 661 | Individual functions, documented below, offer fine-grained control over analysis options. The following analysis provides an example workflow for accomplishing a sentiment analysis with this package. 662 | 663 | ```racket 664 | ;;; We'll use Racket's net/url package to obtain our text, 665 | ;;; data-science to process the text, and plot to visualize the 666 | ;;; results 667 | (require net/url) 668 | (require data-science) 669 | (require plot) 670 | (require math) 671 | 672 | ;;; We'll use the text of Moby Dick, available for free 673 | ;;; on Project Gutenberg 674 | (define moby (string->url "http://www.gutenberg.org/files/2701/2701.txt")) 675 | 676 | ;;; Open a connection port to the URL 677 | (define in (get-pure-port moby #:redirections 5)) 678 | 679 | ;;; Next, we capture the text from our input port, removing capitalization, 680 | ;;; punctuation, and then extra spaces 681 | (define moby-text (string-normalize-spaces 682 | (remove-punctuation 683 | (string-downcase (port->string in)) #:websafe? #t))) 684 | 685 | ;;; Close the input port 686 | (close-input-port in) 687 | 688 | ;;; To begin our sentiment analysis, we extract each unique word 689 | ;;; and the number of times it occurred in the document 690 | (define words (document->tokens moby-text #:sort? #t)) 691 | 692 | ;;; Using the nrc lexicon, we can label each (non stop-word) with an 693 | ;;; emotional label. 694 | (define sentiment (list->sentiment words #:lexicon 'nrc)) 695 | 696 | ;;; We can take a sneak peak at the data... 697 | (take sentiment 5) 698 | ;;; --> '(("word" "sentiment" "freq") 699 | ;;; ("ship" "anticipation" 367) 700 | ;;; ("sea" "positive" 364) 701 | ;;; ("time" "anticipation" 318) 702 | ;;; ("long" "anticipation" 311)) 703 | 704 | ;;; sentiment, created above, consists of a list of triplets of the pattern 705 | ;;; (token sentiment freq) for each token in the document. Many words will have 706 | ;;; the same sentiment label, so we aggregrate (by summing) across such tokens. 707 | (aggregate sum ($ sentiment 'sentiment) ($ sentiment 'freq)) 708 | ;;; --> '(("anticipation" 4739) 709 | ;;; ("positive" 9206) 710 | ;;; ("joy" 3196) 711 | ;;; ("trust" 5095) 712 | ;;; ("surprise" 2157) 713 | ;;; ("negative" 7090) 714 | ;;; ("fear" 4136) 715 | ;;; ("sadness" 3317) 716 | ;;; ("anger" 2765) 717 | ;;; ("disgust" 1958)) 718 | 719 | ;;; Better yet, we can visualize this result as a barplot (discrete-histogram) 720 | (let ([counts (aggregate sum ($ sentiment 'sentiment) ($ sentiment 'freq))]) 721 | (parameterize ((plot-width 800)) 722 | (plot (list 723 | (tick-grid) 724 | (discrete-histogram 725 | (sort counts (λ (x y) (> (second x) (second y)))) 726 | #:color "MediumSlateBlue" 727 | #:line-color "MediumSlateBlue")) 728 | #:x-label "Affective Label" 729 | #:y-label "Frequency"))) 730 | ``` 731 | 732 | ![Affective Sentiment Labels](https://github.com/n3mo/data-science/raw/master/img/sentiment-labels.png) 733 | 734 | ```racket 735 | ;;; Or, use the bing lexicon to determine the ratio of 736 | ;;; positive-to-negative words 737 | (define sentiment (list->sentiment words #:lexicon 'bing)) 738 | (parameterize ([plot-height 200]) 739 | (plot (discrete-histogram 740 | (aggregate sum ($ sentiment 'sentiment) ($ sentiment 'freq)) 741 | #:y-min 0 742 | #:y-max 8000 743 | #:invert? #t 744 | #:color "MediumOrchid" 745 | #:line-color "MediumOrchid") 746 | #:x-label "Frequency" 747 | #:y-label "Sentiment Polarity")) 748 | ``` 749 | 750 | ![Sentiment Polarity](https://github.com/n3mo/data-science/raw/master/img/sentiment-positivity.png) 751 | 752 | ```racket 753 | ;;; It seems that the text is slightly more negative than positive. We 754 | ;;; test this using a chi-square goodness of fit test 755 | (let ([counts (aggregate sum ($ sentiment 'sentiment) ($ sentiment 'freq))]) 756 | (chi-square-goodness counts '(.5 .5))) 757 | ;;; --> '#hash(('result . "significant") 758 | ;;; ('chisqr . 49.40294802172227) 759 | ;;; ('df . 1) 760 | ;;; ('criterion . 3.8414588206941254) 761 | ;;; ('alpha . 0.05)) 762 | ;;; 763 | ;;; It does seem to be a significant difference 764 | ``` 765 | 766 | ```racket 767 | ;;; We can also look at which words are contributing the most to our 768 | ;;; positive and negative sentiment scores. We'll look at the top 15 769 | ;;; influential (i.e., most frequent) positive and negative words 770 | (define negative-tokens 771 | (take (cdr (subset sentiment 'sentiment "negative")) 15)) 772 | (define positive-tokens 773 | (take (cdr (subset sentiment 'sentiment "positive")) 15)) 774 | 775 | ;;; Some clever reshaping for plotting purposes 776 | (define n (map (λ (x) (list (first x) (- 0 (third x)))) 777 | negative-tokens)) 778 | (define p (sort (map (λ (x) (list (first x) (third x))) 779 | positive-tokens) 780 | (λ (x y) (< (second x) (second y))))) 781 | 782 | ;;; Plot the results 783 | (parameterize ((plot-width 800) 784 | (plot-x-tick-label-anchor 'right) 785 | (plot-x-tick-label-angle 90)) 786 | (plot (list 787 | (tick-grid) 788 | (discrete-histogram n #:y-min -120 789 | #:y-max 655 790 | #:color "OrangeRed" 791 | #:line-color "OrangeRed" 792 | #:label "Negative Sentiment") 793 | (discrete-histogram p #:y-min -116 794 | #:y-max 649 795 | #:x-min 15 796 | #:color "LightSeaGreen" 797 | #:line-color "LightSeaGreen" 798 | #:label "Positive Sentiment")) 799 | #:x-label "Word" 800 | #:y-label "Contribution to sentiment")) 801 | 802 | ;;; It seems that the word "like" is contributing extensively to the 803 | ;;; positive sentiment. A more thorough analysis might 804 | ;;; remove this word given its more common use as simile. 805 | ``` 806 | 807 | ![Word Contributions](https://github.com/n3mo/data-science/raw/master/img/sentiment-contributions.png) 808 | 809 | ```racket 810 | ;;; Or, use the AFINN lexicon to determine the document's 811 | ;;; affective polarity 812 | (define sentiment (list->sentiment words #:lexicon 'AFINN)) 813 | (sum (map (λ (x) (* (second x) (third x))) (cdr sentiment))) 814 | ;;; --> 1220 815 | ``` 816 | 817 | ### token->sentiment 818 | 819 | ```racket 820 | (token->sentiment token [#:lexicon 'nrc]) 821 | ``` 822 | 823 | For a given word/token `token`, returns its corresponding sentiment value if possible. `#:lexicon` can be the symbols: 824 | 825 | - nrc --> Returns an affective label from the set (anger anticipation disgust fear negative positive sadness surprise trust), or '() if `token` is unknown. 826 | - bing --> Returns a polarity label from the set (negative positive), or '() if `token` is unknown. 827 | - AFINN --> Returns a sentiment score ranging from -4 (very negative) to +4 (very positive), or 0 if `token` is unknown. 828 | 829 | Examples: 830 | 831 | ```racket 832 | ;;; nrc lexicon examples -------------------- 833 | 834 | (token->sentiment "marriage" #:lexicon 'nrc) 835 | ;;; --> '(("marriage" "anticipation") 836 | ;;; ("marriage" "joy") 837 | ;;; ("marriage" "positive") 838 | ;;; ("marriage" "trust")) 839 | 840 | (token->sentiment "fire" #:lexicon 'nrc) 841 | ;;; --> '(("fire" "fear")) 842 | 843 | (token->sentiment "the" #:lexicon 'nrc) 844 | ;;; --> '() 845 | 846 | ;;; bing lexicon examples -------------------- 847 | 848 | (token->sentiment "love" #:lexicon 'bing) 849 | ;;; --> '(("love" "positive")) 850 | 851 | (token->sentiment "hate" #:lexicon 'bing) 852 | ;;; --> '(("hate" "negative")) 853 | 854 | (token->sentiment "the" #:lexicon 'bing) 855 | ;;; --> '() 856 | 857 | ;;; AFINN lexicon examples -------------------- 858 | 859 | (token->sentiment "love" #:lexicon 'AFINN) 860 | ;;; --> '(("love" 3)) 861 | 862 | (token->sentiment "cry" #:lexicon 'AFINN) 863 | ;;; --> '(("cry" -1)) 864 | 865 | (token->sentiment "everest" #:lexicon 'AFINN) 866 | ;;; --> '(("everest" 0)) 867 | ``` 868 | 869 | ### list->sentiment 870 | 871 | ```racket 872 | (list->sentiment lst [#:lexicon 'nrc]) 873 | ``` 874 | 875 | Returns a list of sentiment values for `lst`, which is a list of pairs of words/tokens and their frequency, as returned by `document->tokens`. Returns a list of triplets of the form (token sentiment frequency). `#:lexicon` can be the symbols: 876 | 877 | - nrc --> Returns an affective label from the set (anger anticipation disgust fear negative positive sadness surprise trust), or '() if `token` is unknown. 878 | - bing --> Returns a polarity label from the set (negative positive), or '() if `token` is unknown. 879 | - AFINN --> Returns a sentiment score ranging from -4 (very negative) to +4 (very positive), or 0 if `token` is unknown. 880 | 881 | Examples: 882 | 883 | ```racket 884 | ;;; Turn a document into word frequencies 885 | (define tokens (document->tokens "happy happy happy love is better than ugly ugly mean old hate")) 886 | ;;; --> '(("happy" 3) 887 | ;;; ("love" 1) 888 | ;;; ("is" 1) 889 | ;;; ("better" 1) 890 | ;;; ("than" 1) 891 | ;;; ("ugly" 2) 892 | ;;; ("mean" 1) 893 | ;;; ("old" 1) 894 | ;;; ("hate" 1)) 895 | 896 | ;;; Convert the tokens into sentiment scores using the nrc lexicon 897 | (list->sentiment tokens #:lexicon 'nrc) 898 | ;;; --> '(("word" "sentiment" "freq") 899 | ;;; ("happy" "anticipation" 3) 900 | ;;; ("happy" "joy" 3) 901 | ;;; ("happy" "positive" 3) 902 | ;;; ("happy" "trust" 3) 903 | ;;; ("love" "joy" 1) 904 | ;;; ("love" "positive" 1) 905 | ;;; ("ugly" "disgust" 2) 906 | ;;; ("ugly" "negative" 2) 907 | ;;; ("hate" "anger" 1) 908 | ;;; ("hate" "disgust" 1) 909 | ;;; ("hate" "fear" 1) 910 | ;;; ("hate" "negative" 1) 911 | ;;; ("hate" "sadness" 1)) 912 | 913 | ;;; Convert the tokens into sentiment scores using the bing lexicon 914 | (list->sentiment tokens #:lexicon 'bing) 915 | ;;; --> '(("word" "sentiment" "freq") 916 | ;;; ("happy" "positive" 3) 917 | ;;; ("love" "positive" 1) 918 | ;;; ("better" "positive" 1) 919 | ;;; ("ugly" "negative" 2) 920 | ;;; ("hate" "negative" 1)) 921 | 922 | ;;; Convert the tokens into sentiment scores using the AFINN lexicon 923 | (list->sentiment tokens #:lexicon 'AFINN) 924 | ;;; --> '(("word" "sentiment" "freq") 925 | ;;; ("happy" 3 3) 926 | ;;; ("love" 3 1) 927 | ;;; ("is" 0 1) 928 | ;;; ("better" 2 1) 929 | ;;; ("than" 0 1) 930 | ;;; ("ugly" -3 2) 931 | ;;; ("mean" 0 1) 932 | ;;; ("old" 0 1) 933 | ;;; ("hate" -3 1)) 934 | ``` 935 | 936 | ## Plotting Functions 937 | 938 | ### Histogram of Sorted Counts 939 | 940 | ```racket 941 | (hist lst) 942 | ``` 943 | ```racket 944 | (hist* lst) 945 | ``` 946 | 947 | Generating discrete histograms of sorted observed frequencies in a sample requires several unnecessarily unwieldy steps. This should be easier. Now it is. `hist` returns a renderer that produces a sorted, discrete histogram of observed frequencies. `hist*` plots the renderer for you for convenience. Both functions use `sorted-counts` to sort and group the data. 948 | 949 | Examples: 950 | 951 | ```racket 952 | ;;; If we roll two dice in a board game, what are the most 953 | ;;; frequent totals? Let's simulate rolling 500 pairs of dice 954 | (define die-1 (build-list 500 (λ (n) (random 1 7)))) 955 | (define die-2 (build-list 500 (λ (n) (random 1 7)))) 956 | (define total-roll (map + die-1 die-2)) 957 | 958 | ;;; Aha... this is why we get robbed so often in Settlers of Catan! 959 | (hist* total-roll) 960 | ``` 961 | 962 | ![Hist Plot](https://github.com/n3mo/data-science/raw/master/img/hist-example.png) 963 | 964 | ```racket 965 | ;;; We can generate the same hist figure above manually, exercising 966 | ;;; some control over the plot details. Let's make an ugly green histogram 967 | (parameterize ([rectangle-color "lightgreen"]) 968 | (plot (hist total-roll) 969 | #:x-label "Dice Roll" 970 | #:y-label "Frequency")) 971 | ``` 972 | 973 | ### Quantile-Quantile (Q-Q) Plot 974 | 975 | ```racket 976 | (qq-plot lst [#:scale? #t]) 977 | ``` 978 | ```racket 979 | (qq-plot* lst [#:scale? #t]) 980 | ``` 981 | 982 | Plots sample quantiles against theoretical quantiles from a normal distribution with a mean and standard deviation of the sample `lst`. By default, both sequences of quantiles are z-transformed. Suppress this behavior with #:scale? #f. `qq-plot` returns a renderer to be used with `plot`, `plot-file`, etc. `qq-plot*` produces a plotted figure for quick convenience. 983 | 984 | Examples: 985 | 986 | ```racket 987 | ;;; Normal data should plot close to y = x 988 | (qq-plot* (sample (normal-dist 0 1) 500)) 989 | ``` 990 | 991 | ![Q-Q Plot](https://github.com/n3mo/data-science/raw/master/img/qq-plot-example.png) 992 | 993 | ```racket 994 | ;;; Non-normal data is visibly non-linear. These data are drawn 995 | ;;; from a right-skewed gamma distribution 996 | (qq-plot* (sample (gamma-dist 2 2) 500)) 997 | ``` 998 | 999 | ![Q-Q Skewed Plot](https://github.com/n3mo/data-science/raw/master/img/qq-plot-skewed-example.png) 1000 | 1001 | ```racket 1002 | ;;; Use qq-plot to return a renderer. With this, you can exercise 1003 | ;;; manual control with the workflow typical of the plot package 1004 | (parameterize ([point-size 10] 1005 | [point-color "blue"]) 1006 | (plot (list (qq-plot (sample (gamma-dist 2 2) 500)) 1007 | (function identity #:color "red" #:width 2)) 1008 | #:x-label "Theoretical Quantiles" 1009 | #:y-label "Sample Quantiles (n = 500)")) 1010 | ``` 1011 | 1012 | ![Q-Q Manual Plot](https://github.com/n3mo/data-science/raw/master/img/qq-manual-example.png) 1013 | 1014 | # Bugs & Improvements 1015 | 1016 | Please report any problems that you find, along with any suggestions or contributions. 1017 | 1018 | You can support this project, or my other projects via [ChangeTip](http://n3mo.tip.me) 1019 | 1020 | [![Support via ChangeTip](http://www.nicholasvanhorn.com/images/changetip.png)](http://n3mo.tip.me) 1021 | 1022 | 1023 | # License 1024 | 1025 | Copyright (C) 2016 Nicholas M. Van Horn 1026 | 1027 | Author: Nicholas M. Van Horn 1028 | 1029 | This program is free software; you can redistribute it and/or modify 1030 | it under the terms of the GNU General Public License as published by 1031 | the Free Software Foundation, either version 3 of the License, or 1032 | (at your option) any later version. 1033 | 1034 | This program is distributed in the hope that it will be useful, 1035 | but WITHOUT ANY WARRANTY; without even the implied warranty of 1036 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1037 | GNU General Public License for more details. 1038 | 1039 | You should have received a copy of the GNU General Public License 1040 | along with this program. If not, see . 1041 | -------------------------------------------------------------------------------- /img/hist-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/hist-example.png -------------------------------------------------------------------------------- /img/qq-manual-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/qq-manual-example.png -------------------------------------------------------------------------------- /img/qq-plot-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/qq-plot-example.png -------------------------------------------------------------------------------- /img/qq-plot-skewed-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/qq-plot-skewed-example.png -------------------------------------------------------------------------------- /img/regression-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/regression-example.png -------------------------------------------------------------------------------- /img/residuals-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/residuals-example.png -------------------------------------------------------------------------------- /img/sentiment-contributions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/sentiment-contributions.png -------------------------------------------------------------------------------- /img/sentiment-labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/sentiment-labels.png -------------------------------------------------------------------------------- /img/sentiment-positivity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n3mo/data-science/ffed5b000b07de02d85c279bb55e83d13d00254b/img/sentiment-positivity.png -------------------------------------------------------------------------------- /info.rkt: -------------------------------------------------------------------------------- 1 | #lang info 2 | 3 | (define collection "data-science") 4 | (define version "0.1") 5 | (define deps '("base" "math" "math" "plot" "csv-reading")) 6 | 7 | -------------------------------------------------------------------------------- /lexicons/AFINN-lexicon: -------------------------------------------------------------------------------- 1 | #lang racket/base 2 | (provide AFINN) 3 | 4 | (define AFINN '(("word" "sentiment" "lexicon" "score") ("abandon" "NA" "AFINN" "-2") ("abandoned" "NA" "AFINN" "-2") ("abandons" "NA" "AFINN" "-2") ("abducted" "NA" "AFINN" "-2") ("abduction" "NA" "AFINN" "-2") ("abductions" "NA" "AFINN" "-2") ("abhor" "NA" "AFINN" "-3") ("abhorred" "NA" "AFINN" "-3") ("abhorrent" "NA" "AFINN" "-3") ("abhors" "NA" "AFINN" "-3") ("abilities" "NA" "AFINN" "2") ("ability" "NA" "AFINN" "2") ("aboard" "NA" "AFINN" "1") ("absentee" "NA" "AFINN" "-1") ("absentees" "NA" "AFINN" "-1") ("absolve" "NA" "AFINN" "2") ("absolved" "NA" "AFINN" "2") ("absolves" "NA" "AFINN" "2") ("absolving" "NA" "AFINN" "2") ("absorbed" "NA" "AFINN" "1") ("abuse" "NA" "AFINN" "-3") ("abused" "NA" "AFINN" "-3") ("abuses" "NA" "AFINN" "-3") ("abusive" "NA" "AFINN" "-3") ("accept" "NA" "AFINN" "1") ("accepted" "NA" "AFINN" "1") ("accepting" "NA" "AFINN" "1") ("accepts" "NA" "AFINN" "1") ("accident" "NA" "AFINN" "-2") ("accidental" "NA" "AFINN" "-2") ("accidentally" "NA" "AFINN" "-2") ("accidents" "NA" "AFINN" "-2") ("accomplish" "NA" "AFINN" "2") ("accomplished" "NA" "AFINN" "2") ("accomplishes" "NA" "AFINN" "2") ("accusation" "NA" "AFINN" "-2") ("accusations" "NA" "AFINN" "-2") ("accuse" "NA" "AFINN" "-2") ("accused" "NA" "AFINN" "-2") ("accuses" "NA" "AFINN" "-2") ("accusing" "NA" "AFINN" "-2") ("ache" "NA" "AFINN" "-2") ("achievable" "NA" "AFINN" "1") ("aching" "NA" "AFINN" "-2") ("acquit" "NA" "AFINN" "2") ("acquits" "NA" "AFINN" "2") ("acquitted" "NA" "AFINN" "2") ("acquitting" "NA" "AFINN" "2") ("acrimonious" "NA" "AFINN" "-3") ("active" "NA" "AFINN" "1") ("adequate" "NA" "AFINN" "1") ("admire" "NA" "AFINN" "3") ("admired" "NA" "AFINN" "3") ("admires" "NA" "AFINN" "3") ("admiring" "NA" "AFINN" "3") ("admit" "NA" "AFINN" "-1") ("admits" "NA" "AFINN" "-1") ("admitted" "NA" "AFINN" "-1") ("admonish" "NA" "AFINN" "-2") ("admonished" "NA" "AFINN" "-2") ("adopt" "NA" "AFINN" "1") ("adopts" "NA" "AFINN" "1") ("adorable" "NA" "AFINN" "3") ("adore" "NA" "AFINN" "3") ("adored" "NA" "AFINN" "3") ("adores" "NA" "AFINN" "3") ("advanced" "NA" "AFINN" "1") ("advantage" "NA" "AFINN" "2") ("advantages" "NA" "AFINN" "2") ("adventure" "NA" "AFINN" "2") ("adventures" "NA" "AFINN" "2") ("adventurous" "NA" "AFINN" "2") ("affected" "NA" "AFINN" "-1") ("affection" "NA" "AFINN" "3") ("affectionate" "NA" "AFINN" "3") ("afflicted" "NA" "AFINN" "-1") ("affronted" "NA" "AFINN" "-1") ("afraid" "NA" "AFINN" "-2") ("aggravate" "NA" "AFINN" "-2") ("aggravated" "NA" "AFINN" "-2") ("aggravates" "NA" "AFINN" "-2") ("aggravating" "NA" "AFINN" "-2") ("aggression" "NA" "AFINN" "-2") ("aggressions" "NA" "AFINN" "-2") ("aggressive" "NA" "AFINN" "-2") ("aghast" "NA" "AFINN" "-2") ("agog" "NA" "AFINN" "2") ("agonise" "NA" "AFINN" "-3") ("agonised" "NA" "AFINN" "-3") ("agonises" "NA" "AFINN" "-3") ("agonising" "NA" "AFINN" "-3") ("agonize" "NA" "AFINN" "-3") ("agonized" "NA" "AFINN" "-3") ("agonizes" "NA" "AFINN" "-3") ("agonizing" "NA" "AFINN" "-3") ("agree" "NA" "AFINN" "1") ("agreeable" "NA" "AFINN" "2") ("agreed" "NA" "AFINN" "1") ("agreement" "NA" "AFINN" "1") ("agrees" "NA" "AFINN" "1") ("alarm" "NA" "AFINN" "-2") ("alarmed" "NA" "AFINN" "-2") ("alarmist" "NA" "AFINN" "-2") ("alarmists" "NA" "AFINN" "-2") ("alas" "NA" "AFINN" "-1") ("alert" "NA" "AFINN" "-1") ("alienation" "NA" "AFINN" "-2") ("alive" "NA" "AFINN" "1") ("allergic" "NA" "AFINN" "-2") ("allow" "NA" "AFINN" "1") ("alone" "NA" "AFINN" "-2") ("amaze" "NA" "AFINN" "2") ("amazed" "NA" "AFINN" "2") ("amazes" "NA" "AFINN" "2") ("amazing" "NA" "AFINN" "4") ("ambitious" "NA" "AFINN" "2") ("ambivalent" "NA" "AFINN" "-1") ("amuse" "NA" "AFINN" "3") ("amused" "NA" "AFINN" "3") ("amusement" "NA" "AFINN" "3") ("amusements" "NA" "AFINN" "3") ("anger" "NA" "AFINN" "-3") ("angers" "NA" "AFINN" "-3") ("angry" "NA" "AFINN" "-3") ("anguish" "NA" "AFINN" "-3") ("anguished" "NA" "AFINN" "-3") ("animosity" "NA" "AFINN" "-2") ("annoy" "NA" "AFINN" "-2") ("annoyance" "NA" "AFINN" "-2") ("annoyed" "NA" "AFINN" "-2") ("annoying" "NA" "AFINN" "-2") ("annoys" "NA" "AFINN" "-2") ("antagonistic" "NA" "AFINN" "-2") ("anti" "NA" "AFINN" "-1") ("anticipation" "NA" "AFINN" "1") ("anxiety" "NA" "AFINN" "-2") ("anxious" "NA" "AFINN" "-2") ("apathetic" "NA" "AFINN" "-3") ("apathy" "NA" "AFINN" "-3") ("apeshit" "NA" "AFINN" "-3") ("apocalyptic" "NA" "AFINN" "-2") ("apologise" "NA" "AFINN" "-1") ("apologised" "NA" "AFINN" "-1") ("apologises" "NA" "AFINN" "-1") ("apologising" "NA" "AFINN" "-1") ("apologize" "NA" "AFINN" "-1") ("apologized" "NA" "AFINN" "-1") ("apologizes" "NA" "AFINN" "-1") ("apologizing" "NA" "AFINN" "-1") ("apology" "NA" "AFINN" "-1") ("appalled" "NA" "AFINN" "-2") ("appalling" "NA" "AFINN" "-2") ("appease" "NA" "AFINN" "2") ("appeased" "NA" "AFINN" "2") ("appeases" "NA" "AFINN" "2") ("appeasing" "NA" "AFINN" "2") ("applaud" "NA" "AFINN" "2") ("applauded" "NA" "AFINN" "2") ("applauding" "NA" "AFINN" "2") ("applauds" "NA" "AFINN" "2") ("applause" "NA" "AFINN" "2") ("appreciate" "NA" "AFINN" "2") ("appreciated" "NA" "AFINN" "2") ("appreciates" "NA" "AFINN" "2") ("appreciating" "NA" "AFINN" "2") ("appreciation" "NA" "AFINN" "2") ("apprehensive" "NA" "AFINN" "-2") ("approval" "NA" "AFINN" "2") ("approved" "NA" "AFINN" "2") ("approves" "NA" "AFINN" "2") ("ardent" "NA" "AFINN" "1") ("arrest" "NA" "AFINN" "-2") ("arrested" "NA" "AFINN" "-3") ("arrests" "NA" "AFINN" "-2") ("arrogant" "NA" "AFINN" "-2") ("ashame" "NA" "AFINN" "-2") ("ashamed" "NA" "AFINN" "-2") ("ass" "NA" "AFINN" "-4") ("assassination" "NA" "AFINN" "-3") ("assassinations" "NA" "AFINN" "-3") ("asset" "NA" "AFINN" "2") ("assets" "NA" "AFINN" "2") ("assfucking" "NA" "AFINN" "-4") ("asshole" "NA" "AFINN" "-4") ("astonished" "NA" "AFINN" "2") ("astound" "NA" "AFINN" "3") ("astounded" "NA" "AFINN" "3") ("astounding" "NA" "AFINN" "3") ("astoundingly" "NA" "AFINN" "3") ("astounds" "NA" "AFINN" "3") ("attack" "NA" "AFINN" "-1") ("attacked" "NA" "AFINN" "-1") ("attacking" "NA" "AFINN" "-1") ("attacks" "NA" "AFINN" "-1") ("attract" "NA" "AFINN" "1") ("attracted" "NA" "AFINN" "1") ("attracting" "NA" "AFINN" "2") ("attraction" "NA" "AFINN" "2") ("attractions" "NA" "AFINN" "2") ("attracts" "NA" "AFINN" "1") ("audacious" "NA" "AFINN" "3") ("authority" "NA" "AFINN" "1") ("avert" "NA" "AFINN" "-1") ("averted" "NA" "AFINN" "-1") ("averts" "NA" "AFINN" "-1") ("avid" "NA" "AFINN" "2") ("avoid" "NA" "AFINN" "-1") ("avoided" "NA" "AFINN" "-1") ("avoids" "NA" "AFINN" "-1") ("await" "NA" "AFINN" "-1") ("awaited" "NA" "AFINN" "-1") ("awaits" "NA" "AFINN" "-1") ("award" "NA" "AFINN" "3") ("awarded" "NA" "AFINN" "3") ("awards" "NA" "AFINN" "3") ("awesome" "NA" "AFINN" "4") ("awful" "NA" "AFINN" "-3") ("awkward" "NA" "AFINN" "-2") ("axe" "NA" "AFINN" "-1") ("axed" "NA" "AFINN" "-1") ("backed" "NA" "AFINN" "1") ("backing" "NA" "AFINN" "2") ("backs" "NA" "AFINN" "1") ("bad" "NA" "AFINN" "-3") ("badass" "NA" "AFINN" "-3") ("badly" "NA" "AFINN" "-3") ("bailout" "NA" "AFINN" "-2") ("bamboozle" "NA" "AFINN" "-2") ("bamboozled" "NA" "AFINN" "-2") ("bamboozles" "NA" "AFINN" "-2") ("ban" "NA" "AFINN" "-2") ("banish" "NA" "AFINN" "-1") ("bankrupt" "NA" "AFINN" "-3") ("bankster" "NA" "AFINN" "-3") ("banned" "NA" "AFINN" "-2") ("bargain" "NA" "AFINN" "2") ("barrier" "NA" "AFINN" "-2") ("bastard" "NA" "AFINN" "-5") ("bastards" "NA" "AFINN" "-5") ("battle" "NA" "AFINN" "-1") ("battles" "NA" "AFINN" "-1") ("beaten" "NA" "AFINN" "-2") ("beatific" "NA" "AFINN" "3") ("beating" "NA" "AFINN" "-1") ("beauties" "NA" "AFINN" "3") ("beautiful" "NA" "AFINN" "3") ("beautifully" "NA" "AFINN" "3") ("beautify" "NA" "AFINN" "3") ("belittle" "NA" "AFINN" "-2") ("belittled" "NA" "AFINN" "-2") ("beloved" "NA" "AFINN" "3") ("benefit" "NA" "AFINN" "2") ("benefits" "NA" "AFINN" "2") ("benefitted" "NA" "AFINN" "2") ("benefitting" "NA" "AFINN" "2") ("bereave" "NA" "AFINN" "-2") ("bereaved" "NA" "AFINN" "-2") ("bereaves" "NA" "AFINN" "-2") ("bereaving" "NA" "AFINN" "-2") ("best" "NA" "AFINN" "3") ("betray" "NA" "AFINN" "-3") ("betrayal" "NA" "AFINN" "-3") ("betrayed" "NA" "AFINN" "-3") ("betraying" "NA" "AFINN" "-3") ("betrays" "NA" "AFINN" "-3") ("better" "NA" "AFINN" "2") ("bias" "NA" "AFINN" "-1") ("biased" "NA" "AFINN" "-2") ("big" "NA" "AFINN" "1") ("bitch" "NA" "AFINN" "-5") ("bitches" "NA" "AFINN" "-5") ("bitter" "NA" "AFINN" "-2") ("bitterly" "NA" "AFINN" "-2") ("bizarre" "NA" "AFINN" "-2") ("blah" "NA" "AFINN" "-2") ("blame" "NA" "AFINN" "-2") ("blamed" "NA" "AFINN" "-2") ("blames" "NA" "AFINN" "-2") ("blaming" "NA" "AFINN" "-2") ("bless" "NA" "AFINN" "2") ("blesses" "NA" "AFINN" "2") ("blessing" "NA" "AFINN" "3") ("blind" "NA" "AFINN" "-1") ("bliss" "NA" "AFINN" "3") ("blissful" "NA" "AFINN" "3") ("blithe" "NA" "AFINN" "2") ("block" "NA" "AFINN" "-1") ("blockbuster" "NA" "AFINN" "3") ("blocked" "NA" "AFINN" "-1") ("blocking" "NA" "AFINN" "-1") ("blocks" "NA" "AFINN" "-1") ("bloody" "NA" "AFINN" "-3") ("blurry" "NA" "AFINN" "-2") ("boastful" "NA" "AFINN" "-2") ("bold" "NA" "AFINN" "2") ("boldly" "NA" "AFINN" "2") ("bomb" "NA" "AFINN" "-1") ("boost" "NA" "AFINN" "1") ("boosted" "NA" "AFINN" "1") ("boosting" "NA" "AFINN" "1") ("boosts" "NA" "AFINN" "1") ("bore" "NA" "AFINN" "-2") ("bored" "NA" "AFINN" "-2") ("boring" "NA" "AFINN" "-3") ("bother" "NA" "AFINN" "-2") ("bothered" "NA" "AFINN" "-2") ("bothers" "NA" "AFINN" "-2") ("bothersome" "NA" "AFINN" "-2") ("boycott" "NA" "AFINN" "-2") ("boycotted" "NA" "AFINN" "-2") ("boycotting" "NA" "AFINN" "-2") ("boycotts" "NA" "AFINN" "-2") ("brainwashing" "NA" "AFINN" "-3") ("brave" "NA" "AFINN" "2") ("breakthrough" "NA" "AFINN" "3") ("breathtaking" "NA" "AFINN" "5") ("bribe" "NA" "AFINN" "-3") ("bright" "NA" "AFINN" "1") ("brightest" "NA" "AFINN" "2") ("brightness" "NA" "AFINN" "1") ("brilliant" "NA" "AFINN" "4") ("brisk" "NA" "AFINN" "2") ("broke" "NA" "AFINN" "-1") ("broken" "NA" "AFINN" "-1") ("brooding" "NA" "AFINN" "-2") ("bullied" "NA" "AFINN" "-2") ("bullshit" "NA" "AFINN" "-4") ("bully" "NA" "AFINN" "-2") ("bullying" "NA" "AFINN" "-2") ("bummer" "NA" "AFINN" "-2") ("buoyant" "NA" "AFINN" "2") ("burden" "NA" "AFINN" "-2") ("burdened" "NA" "AFINN" "-2") ("burdening" "NA" "AFINN" "-2") ("burdens" "NA" "AFINN" "-2") ("calm" "NA" "AFINN" "2") ("calmed" "NA" "AFINN" "2") ("calming" "NA" "AFINN" "2") ("calms" "NA" "AFINN" "2") ("can't stand" "NA" "AFINN" "-3") ("cancel" "NA" "AFINN" "-1") ("cancelled" "NA" "AFINN" "-1") ("cancelling" "NA" "AFINN" "-1") ("cancels" "NA" "AFINN" "-1") ("cancer" "NA" "AFINN" "-1") ("capable" "NA" "AFINN" "1") ("captivated" "NA" "AFINN" "3") ("care" "NA" "AFINN" "2") ("carefree" "NA" "AFINN" "1") ("careful" "NA" "AFINN" "2") ("carefully" "NA" "AFINN" "2") ("careless" "NA" "AFINN" "-2") ("cares" "NA" "AFINN" "2") ("cashing in" "NA" "AFINN" "-2") ("casualty" "NA" "AFINN" "-2") ("catastrophe" "NA" "AFINN" "-3") ("catastrophic" "NA" "AFINN" "-4") ("cautious" "NA" "AFINN" "-1") ("celebrate" "NA" "AFINN" "3") ("celebrated" "NA" "AFINN" "3") ("celebrates" "NA" "AFINN" "3") ("celebrating" "NA" "AFINN" "3") ("censor" "NA" "AFINN" "-2") ("censored" "NA" "AFINN" "-2") ("censors" "NA" "AFINN" "-2") ("certain" "NA" "AFINN" "1") ("chagrin" "NA" "AFINN" "-2") ("chagrined" "NA" "AFINN" "-2") ("challenge" "NA" "AFINN" "-1") ("chance" "NA" "AFINN" "2") ("chances" "NA" "AFINN" "2") ("chaos" "NA" "AFINN" "-2") ("chaotic" "NA" "AFINN" "-2") ("charged" "NA" "AFINN" "-3") ("charges" "NA" "AFINN" "-2") ("charm" "NA" "AFINN" "3") ("charming" "NA" "AFINN" "3") ("charmless" "NA" "AFINN" "-3") ("chastise" "NA" "AFINN" "-3") ("chastised" "NA" "AFINN" "-3") ("chastises" "NA" "AFINN" "-3") ("chastising" "NA" "AFINN" "-3") ("cheat" "NA" "AFINN" "-3") ("cheated" "NA" "AFINN" "-3") ("cheater" "NA" "AFINN" "-3") ("cheaters" "NA" "AFINN" "-3") ("cheats" "NA" "AFINN" "-3") ("cheer" "NA" "AFINN" "2") ("cheered" "NA" "AFINN" "2") ("cheerful" "NA" "AFINN" "2") ("cheering" "NA" "AFINN" "2") ("cheerless" "NA" "AFINN" "-2") ("cheers" "NA" "AFINN" "2") ("cheery" "NA" "AFINN" "3") ("cherish" "NA" "AFINN" "2") ("cherished" "NA" "AFINN" "2") ("cherishes" "NA" "AFINN" "2") ("cherishing" "NA" "AFINN" "2") ("chic" "NA" "AFINN" "2") ("childish" "NA" "AFINN" "-2") ("chilling" "NA" "AFINN" "-1") ("choke" "NA" "AFINN" "-2") ("choked" "NA" "AFINN" "-2") ("chokes" "NA" "AFINN" "-2") ("choking" "NA" "AFINN" "-2") ("clarifies" "NA" "AFINN" "2") ("clarity" "NA" "AFINN" "2") ("clash" "NA" "AFINN" "-2") ("classy" "NA" "AFINN" "3") ("clean" "NA" "AFINN" "2") ("cleaner" "NA" "AFINN" "2") ("clear" "NA" "AFINN" "1") ("cleared" "NA" "AFINN" "1") ("clearly" "NA" "AFINN" "1") ("clears" "NA" "AFINN" "1") ("clever" "NA" "AFINN" "2") ("clouded" "NA" "AFINN" "-1") ("clueless" "NA" "AFINN" "-2") ("cock" "NA" "AFINN" "-5") ("cocksucker" "NA" "AFINN" "-5") ("cocksuckers" "NA" "AFINN" "-5") ("cocky" "NA" "AFINN" "-2") ("coerced" "NA" "AFINN" "-2") ("collapse" "NA" "AFINN" "-2") ("collapsed" "NA" "AFINN" "-2") ("collapses" "NA" "AFINN" "-2") ("collapsing" "NA" "AFINN" "-2") ("collide" "NA" "AFINN" "-1") ("collides" "NA" "AFINN" "-1") ("colliding" "NA" "AFINN" "-1") ("collision" "NA" "AFINN" "-2") ("collisions" "NA" "AFINN" "-2") ("colluding" "NA" "AFINN" "-3") ("combat" "NA" "AFINN" "-1") ("combats" "NA" "AFINN" "-1") ("comedy" "NA" "AFINN" "1") ("comfort" "NA" "AFINN" "2") ("comfortable" "NA" "AFINN" "2") ("comforting" "NA" "AFINN" "2") ("comforts" "NA" "AFINN" "2") ("commend" "NA" "AFINN" "2") ("commended" "NA" "AFINN" "2") ("commit" "NA" "AFINN" "1") ("commitment" "NA" "AFINN" "2") ("commits" "NA" "AFINN" "1") ("committed" "NA" "AFINN" "1") ("committing" "NA" "AFINN" "1") ("compassionate" "NA" "AFINN" "2") ("compelled" "NA" "AFINN" "1") ("competent" "NA" "AFINN" "2") ("competitive" "NA" "AFINN" "2") ("complacent" "NA" "AFINN" "-2") ("complain" "NA" "AFINN" "-2") ("complained" "NA" "AFINN" "-2") ("complains" "NA" "AFINN" "-2") ("comprehensive" "NA" "AFINN" "2") ("conciliate" "NA" "AFINN" "2") ("conciliated" "NA" "AFINN" "2") ("conciliates" "NA" "AFINN" "2") ("conciliating" "NA" "AFINN" "2") ("condemn" "NA" "AFINN" "-2") ("condemnation" "NA" "AFINN" "-2") ("condemned" "NA" "AFINN" "-2") ("condemns" "NA" "AFINN" "-2") ("confidence" "NA" "AFINN" "2") ("confident" "NA" "AFINN" "2") ("conflict" "NA" "AFINN" "-2") ("conflicting" "NA" "AFINN" "-2") ("conflictive" "NA" "AFINN" "-2") ("conflicts" "NA" "AFINN" "-2") ("confuse" "NA" "AFINN" "-2") ("confused" "NA" "AFINN" "-2") ("confusing" "NA" "AFINN" "-2") ("congrats" "NA" "AFINN" "2") ("congratulate" "NA" "AFINN" "2") ("congratulation" "NA" "AFINN" "2") ("congratulations" "NA" "AFINN" "2") ("consent" "NA" "AFINN" "2") ("consents" "NA" "AFINN" "2") ("consolable" "NA" "AFINN" "2") ("conspiracy" "NA" "AFINN" "-3") ("constrained" "NA" "AFINN" "-2") ("contagion" "NA" "AFINN" "-2") ("contagions" "NA" "AFINN" "-2") ("contagious" "NA" "AFINN" "-1") ("contempt" "NA" "AFINN" "-2") ("contemptuous" "NA" "AFINN" "-2") ("contemptuously" "NA" "AFINN" "-2") ("contend" "NA" "AFINN" "-1") ("contender" "NA" "AFINN" "-1") ("contending" "NA" "AFINN" "-1") ("contentious" "NA" "AFINN" "-2") ("contestable" "NA" "AFINN" "-2") ("controversial" "NA" "AFINN" "-2") ("controversially" "NA" "AFINN" "-2") ("convince" "NA" "AFINN" "1") ("convinced" "NA" "AFINN" "1") ("convinces" "NA" "AFINN" "1") ("convivial" "NA" "AFINN" "2") ("cool" "NA" "AFINN" "1") ("cool stuff" "NA" "AFINN" "3") ("cornered" "NA" "AFINN" "-2") ("corpse" "NA" "AFINN" "-1") ("costly" "NA" "AFINN" "-2") ("courage" "NA" "AFINN" "2") ("courageous" "NA" "AFINN" "2") ("courteous" "NA" "AFINN" "2") ("courtesy" "NA" "AFINN" "2") ("cover-up" "NA" "AFINN" "-3") ("coward" "NA" "AFINN" "-2") ("cowardly" "NA" "AFINN" "-2") ("coziness" "NA" "AFINN" "2") ("cramp" "NA" "AFINN" "-1") ("crap" "NA" "AFINN" "-3") ("crash" "NA" "AFINN" "-2") ("crazier" "NA" "AFINN" "-2") ("craziest" "NA" "AFINN" "-2") ("crazy" "NA" "AFINN" "-2") ("creative" "NA" "AFINN" "2") ("crestfallen" "NA" "AFINN" "-2") ("cried" "NA" "AFINN" "-2") ("cries" "NA" "AFINN" "-2") ("crime" "NA" "AFINN" "-3") ("criminal" "NA" "AFINN" "-3") ("criminals" "NA" "AFINN" "-3") ("crisis" "NA" "AFINN" "-3") ("critic" "NA" "AFINN" "-2") ("criticism" "NA" "AFINN" "-2") ("criticize" "NA" "AFINN" "-2") ("criticized" "NA" "AFINN" "-2") ("criticizes" "NA" "AFINN" "-2") ("criticizing" "NA" "AFINN" "-2") ("critics" "NA" "AFINN" "-2") ("cruel" "NA" "AFINN" "-3") ("cruelty" "NA" "AFINN" "-3") ("crush" "NA" "AFINN" "-1") ("crushed" "NA" "AFINN" "-2") ("crushes" "NA" "AFINN" "-1") ("crushing" "NA" "AFINN" "-1") ("cry" "NA" "AFINN" "-1") ("crying" "NA" "AFINN" "-2") ("cunt" "NA" "AFINN" "-5") ("curious" "NA" "AFINN" "1") ("curse" "NA" "AFINN" "-1") ("cut" "NA" "AFINN" "-1") ("cute" "NA" "AFINN" "2") ("cuts" "NA" "AFINN" "-1") ("cutting" "NA" "AFINN" "-1") ("cynic" "NA" "AFINN" "-2") ("cynical" "NA" "AFINN" "-2") ("cynicism" "NA" "AFINN" "-2") ("damage" "NA" "AFINN" "-3") ("damages" "NA" "AFINN" "-3") ("damn" "NA" "AFINN" "-4") ("damned" "NA" "AFINN" "-4") ("damnit" "NA" "AFINN" "-4") ("danger" "NA" "AFINN" "-2") ("daredevil" "NA" "AFINN" "2") ("daring" "NA" "AFINN" "2") ("darkest" "NA" "AFINN" "-2") ("darkness" "NA" "AFINN" "-1") ("dauntless" "NA" "AFINN" "2") ("dead" "NA" "AFINN" "-3") ("deadlock" "NA" "AFINN" "-2") ("deafening" "NA" "AFINN" "-1") ("dear" "NA" "AFINN" "2") ("dearly" "NA" "AFINN" "3") ("death" "NA" "AFINN" "-2") ("debonair" "NA" "AFINN" "2") ("debt" "NA" "AFINN" "-2") ("deceit" "NA" "AFINN" "-3") ("deceitful" "NA" "AFINN" "-3") ("deceive" "NA" "AFINN" "-3") ("deceived" "NA" "AFINN" "-3") ("deceives" "NA" "AFINN" "-3") ("deceiving" "NA" "AFINN" "-3") ("deception" "NA" "AFINN" "-3") ("decisive" "NA" "AFINN" "1") ("dedicated" "NA" "AFINN" "2") ("defeated" "NA" "AFINN" "-2") ("defect" "NA" "AFINN" "-3") ("defects" "NA" "AFINN" "-3") ("defender" "NA" "AFINN" "2") ("defenders" "NA" "AFINN" "2") ("defenseless" "NA" "AFINN" "-2") ("defer" "NA" "AFINN" "-1") ("deferring" "NA" "AFINN" "-1") ("defiant" "NA" "AFINN" "-1") ("deficit" "NA" "AFINN" "-2") ("degrade" "NA" "AFINN" "-2") ("degraded" "NA" "AFINN" "-2") ("degrades" "NA" "AFINN" "-2") ("dehumanize" "NA" "AFINN" "-2") ("dehumanized" "NA" "AFINN" "-2") ("dehumanizes" "NA" "AFINN" "-2") ("dehumanizing" "NA" "AFINN" "-2") ("deject" "NA" "AFINN" "-2") ("dejected" "NA" "AFINN" "-2") ("dejecting" "NA" "AFINN" "-2") ("dejects" "NA" "AFINN" "-2") ("delay" "NA" "AFINN" "-1") ("delayed" "NA" "AFINN" "-1") ("delight" "NA" "AFINN" "3") ("delighted" "NA" "AFINN" "3") ("delighting" "NA" "AFINN" "3") ("delights" "NA" "AFINN" "3") ("demand" "NA" "AFINN" "-1") ("demanded" "NA" "AFINN" "-1") ("demanding" "NA" "AFINN" "-1") ("demands" "NA" "AFINN" "-1") ("demonstration" "NA" "AFINN" "-1") ("demoralized" "NA" "AFINN" "-2") ("denied" "NA" "AFINN" "-2") ("denier" "NA" "AFINN" "-2") ("deniers" "NA" "AFINN" "-2") ("denies" "NA" "AFINN" "-2") ("denounce" "NA" "AFINN" "-2") ("denounces" "NA" "AFINN" "-2") ("deny" "NA" "AFINN" "-2") ("denying" "NA" "AFINN" "-2") ("depressed" "NA" "AFINN" "-2") ("depressing" "NA" "AFINN" "-2") ("derail" "NA" "AFINN" "-2") ("derailed" "NA" "AFINN" "-2") ("derails" "NA" "AFINN" "-2") ("deride" "NA" "AFINN" "-2") ("derided" "NA" "AFINN" "-2") ("derides" "NA" "AFINN" "-2") ("deriding" "NA" "AFINN" "-2") ("derision" "NA" "AFINN" "-2") ("desirable" "NA" "AFINN" "2") ("desire" "NA" "AFINN" "1") ("desired" "NA" "AFINN" "2") ("desirous" "NA" "AFINN" "2") ("despair" "NA" "AFINN" "-3") ("despairing" "NA" "AFINN" "-3") ("despairs" "NA" "AFINN" "-3") ("desperate" "NA" "AFINN" "-3") ("desperately" "NA" "AFINN" "-3") ("despondent" "NA" "AFINN" "-3") ("destroy" "NA" "AFINN" "-3") ("destroyed" "NA" "AFINN" "-3") ("destroying" "NA" "AFINN" "-3") ("destroys" "NA" "AFINN" "-3") ("destruction" "NA" "AFINN" "-3") ("destructive" "NA" "AFINN" "-3") ("detached" "NA" "AFINN" "-1") ("detain" "NA" "AFINN" "-2") ("detained" "NA" "AFINN" "-2") ("detention" "NA" "AFINN" "-2") ("determined" "NA" "AFINN" "2") ("devastate" "NA" "AFINN" "-2") ("devastated" "NA" "AFINN" "-2") ("devastating" "NA" "AFINN" "-2") ("devoted" "NA" "AFINN" "3") ("diamond" "NA" "AFINN" "1") ("dick" "NA" "AFINN" "-4") ("dickhead" "NA" "AFINN" "-4") ("die" "NA" "AFINN" "-3") ("died" "NA" "AFINN" "-3") ("difficult" "NA" "AFINN" "-1") ("diffident" "NA" "AFINN" "-2") ("dilemma" "NA" "AFINN" "-1") ("dipshit" "NA" "AFINN" "-3") ("dire" "NA" "AFINN" "-3") ("direful" "NA" "AFINN" "-3") ("dirt" "NA" "AFINN" "-2") ("dirtier" "NA" "AFINN" "-2") ("dirtiest" "NA" "AFINN" "-2") ("dirty" "NA" "AFINN" "-2") ("disabling" "NA" "AFINN" "-1") ("disadvantage" "NA" "AFINN" "-2") ("disadvantaged" "NA" "AFINN" "-2") ("disappear" "NA" "AFINN" "-1") ("disappeared" "NA" "AFINN" "-1") ("disappears" "NA" "AFINN" "-1") ("disappoint" "NA" "AFINN" "-2") ("disappointed" "NA" "AFINN" "-2") ("disappointing" "NA" "AFINN" "-2") ("disappointment" "NA" "AFINN" "-2") ("disappointments" "NA" "AFINN" "-2") ("disappoints" "NA" "AFINN" "-2") ("disaster" "NA" "AFINN" "-2") ("disasters" "NA" "AFINN" "-2") ("disastrous" "NA" "AFINN" "-3") ("disbelieve" "NA" "AFINN" "-2") ("discard" "NA" "AFINN" "-1") ("discarded" "NA" "AFINN" "-1") ("discarding" "NA" "AFINN" "-1") ("discards" "NA" "AFINN" "-1") ("disconsolate" "NA" "AFINN" "-2") ("disconsolation" "NA" "AFINN" "-2") ("discontented" "NA" "AFINN" "-2") ("discord" "NA" "AFINN" "-2") ("discounted" "NA" "AFINN" "-1") ("discouraged" "NA" "AFINN" "-2") ("discredited" "NA" "AFINN" "-2") ("disdain" "NA" "AFINN" "-2") ("disgrace" "NA" "AFINN" "-2") ("disgraced" "NA" "AFINN" "-2") ("disguise" "NA" "AFINN" "-1") ("disguised" "NA" "AFINN" "-1") ("disguises" "NA" "AFINN" "-1") ("disguising" "NA" "AFINN" "-1") ("disgust" "NA" "AFINN" "-3") ("disgusted" "NA" "AFINN" "-3") ("disgusting" "NA" "AFINN" "-3") ("disheartened" "NA" "AFINN" "-2") ("dishonest" "NA" "AFINN" "-2") ("disillusioned" "NA" "AFINN" "-2") ("disinclined" "NA" "AFINN" "-2") ("disjointed" "NA" "AFINN" "-2") ("dislike" "NA" "AFINN" "-2") ("dismal" "NA" "AFINN" "-2") ("dismayed" "NA" "AFINN" "-2") ("disorder" "NA" "AFINN" "-2") ("disorganized" "NA" "AFINN" "-2") ("disoriented" "NA" "AFINN" "-2") ("disparage" "NA" "AFINN" "-2") ("disparaged" "NA" "AFINN" "-2") ("disparages" "NA" "AFINN" "-2") ("disparaging" "NA" "AFINN" "-2") ("displeased" "NA" "AFINN" "-2") ("dispute" "NA" "AFINN" "-2") ("disputed" "NA" "AFINN" "-2") ("disputes" "NA" "AFINN" "-2") ("disputing" "NA" "AFINN" "-2") ("disqualified" "NA" "AFINN" "-2") ("disquiet" "NA" "AFINN" "-2") ("disregard" "NA" "AFINN" "-2") ("disregarded" "NA" "AFINN" "-2") ("disregarding" "NA" "AFINN" "-2") ("disregards" "NA" "AFINN" "-2") ("disrespect" "NA" "AFINN" "-2") ("disrespected" "NA" "AFINN" "-2") ("disruption" "NA" "AFINN" "-2") ("disruptions" "NA" "AFINN" "-2") ("disruptive" "NA" "AFINN" "-2") ("dissatisfied" "NA" "AFINN" "-2") ("distort" "NA" "AFINN" "-2") ("distorted" "NA" "AFINN" "-2") ("distorting" "NA" "AFINN" "-2") ("distorts" "NA" "AFINN" "-2") ("distract" "NA" "AFINN" "-2") ("distracted" "NA" "AFINN" "-2") ("distraction" "NA" "AFINN" "-2") ("distracts" "NA" "AFINN" "-2") ("distress" "NA" "AFINN" "-2") ("distressed" "NA" "AFINN" "-2") ("distresses" "NA" "AFINN" "-2") ("distressing" "NA" "AFINN" "-2") ("distrust" "NA" "AFINN" "-3") ("distrustful" "NA" "AFINN" "-3") ("disturb" "NA" "AFINN" "-2") ("disturbed" "NA" "AFINN" "-2") ("disturbing" "NA" "AFINN" "-2") ("disturbs" "NA" "AFINN" "-2") ("dithering" "NA" "AFINN" "-2") ("dizzy" "NA" "AFINN" "-1") ("dodging" "NA" "AFINN" "-2") ("dodgy" "NA" "AFINN" "-2") ("does not work" "NA" "AFINN" "-3") ("dolorous" "NA" "AFINN" "-2") ("dont like" "NA" "AFINN" "-2") ("doom" "NA" "AFINN" "-2") ("doomed" "NA" "AFINN" "-2") ("doubt" "NA" "AFINN" "-1") ("doubted" "NA" "AFINN" "-1") ("doubtful" "NA" "AFINN" "-1") ("doubting" "NA" "AFINN" "-1") ("doubts" "NA" "AFINN" "-1") ("douche" "NA" "AFINN" "-3") ("douchebag" "NA" "AFINN" "-3") ("downcast" "NA" "AFINN" "-2") ("downhearted" "NA" "AFINN" "-2") ("downside" "NA" "AFINN" "-2") ("drag" "NA" "AFINN" "-1") ("dragged" "NA" "AFINN" "-1") ("drags" "NA" "AFINN" "-1") ("drained" "NA" "AFINN" "-2") ("dread" "NA" "AFINN" "-2") ("dreaded" "NA" "AFINN" "-2") ("dreadful" "NA" "AFINN" "-3") ("dreading" "NA" "AFINN" "-2") ("dream" "NA" "AFINN" "1") ("dreams" "NA" "AFINN" "1") ("dreary" "NA" "AFINN" "-2") ("droopy" "NA" "AFINN" "-2") ("drop" "NA" "AFINN" "-1") ("drown" "NA" "AFINN" "-2") ("drowned" "NA" "AFINN" "-2") ("drowns" "NA" "AFINN" "-2") ("drunk" "NA" "AFINN" "-2") ("dubious" "NA" "AFINN" "-2") ("dud" "NA" "AFINN" "-2") ("dull" "NA" "AFINN" "-2") ("dumb" "NA" "AFINN" "-3") ("dumbass" "NA" "AFINN" "-3") ("dump" "NA" "AFINN" "-1") ("dumped" "NA" "AFINN" "-2") ("dumps" "NA" "AFINN" "-1") ("dupe" "NA" "AFINN" "-2") ("duped" "NA" "AFINN" "-2") ("dysfunction" "NA" "AFINN" "-2") ("eager" "NA" "AFINN" "2") ("earnest" "NA" "AFINN" "2") ("ease" "NA" "AFINN" "2") ("easy" "NA" "AFINN" "1") ("ecstatic" "NA" "AFINN" "4") ("eerie" "NA" "AFINN" "-2") ("eery" "NA" "AFINN" "-2") ("effective" "NA" "AFINN" "2") ("effectively" "NA" "AFINN" "2") ("elated" "NA" "AFINN" "3") ("elation" "NA" "AFINN" "3") ("elegant" "NA" "AFINN" "2") ("elegantly" "NA" "AFINN" "2") ("embarrass" "NA" "AFINN" "-2") ("embarrassed" "NA" "AFINN" "-2") ("embarrasses" "NA" "AFINN" "-2") ("embarrassing" "NA" "AFINN" "-2") ("embarrassment" "NA" "AFINN" "-2") ("embittered" "NA" "AFINN" "-2") ("embrace" "NA" "AFINN" "1") ("emergency" "NA" "AFINN" "-2") ("empathetic" "NA" "AFINN" "2") ("emptiness" "NA" "AFINN" "-1") ("empty" "NA" "AFINN" "-1") ("enchanted" "NA" "AFINN" "2") ("encourage" "NA" "AFINN" "2") ("encouraged" "NA" "AFINN" "2") ("encouragement" "NA" "AFINN" "2") ("encourages" "NA" "AFINN" "2") ("endorse" "NA" "AFINN" "2") ("endorsed" "NA" "AFINN" "2") ("endorsement" "NA" "AFINN" "2") ("endorses" "NA" "AFINN" "2") ("enemies" "NA" "AFINN" "-2") ("enemy" "NA" "AFINN" "-2") ("energetic" "NA" "AFINN" "2") ("engage" "NA" "AFINN" "1") ("engages" "NA" "AFINN" "1") ("engrossed" "NA" "AFINN" "1") ("enjoy" "NA" "AFINN" "2") ("enjoying" "NA" "AFINN" "2") ("enjoys" "NA" "AFINN" "2") ("enlighten" "NA" "AFINN" "2") ("enlightened" "NA" "AFINN" "2") ("enlightening" "NA" "AFINN" "2") ("enlightens" "NA" "AFINN" "2") ("ennui" "NA" "AFINN" "-2") ("enrage" "NA" "AFINN" "-2") ("enraged" "NA" "AFINN" "-2") ("enrages" "NA" "AFINN" "-2") ("enraging" "NA" "AFINN" "-2") ("enrapture" "NA" "AFINN" "3") ("enslave" "NA" "AFINN" "-2") ("enslaved" "NA" "AFINN" "-2") ("enslaves" "NA" "AFINN" "-2") ("ensure" "NA" "AFINN" "1") ("ensuring" "NA" "AFINN" "1") ("enterprising" "NA" "AFINN" "1") ("entertaining" "NA" "AFINN" "2") ("enthral" "NA" "AFINN" "3") ("enthusiastic" "NA" "AFINN" "3") ("entitled" "NA" "AFINN" "1") ("entrusted" "NA" "AFINN" "2") ("envies" "NA" "AFINN" "-1") ("envious" "NA" "AFINN" "-2") ("envy" "NA" "AFINN" "-1") ("envying" "NA" "AFINN" "-1") ("erroneous" "NA" "AFINN" "-2") ("error" "NA" "AFINN" "-2") ("errors" "NA" "AFINN" "-2") ("escape" "NA" "AFINN" "-1") ("escapes" "NA" "AFINN" "-1") ("escaping" "NA" "AFINN" "-1") ("esteemed" "NA" "AFINN" "2") ("ethical" "NA" "AFINN" "2") ("euphoria" "NA" "AFINN" "3") ("euphoric" "NA" "AFINN" "4") ("eviction" "NA" "AFINN" "-1") ("evil" "NA" "AFINN" "-3") ("exaggerate" "NA" "AFINN" "-2") ("exaggerated" "NA" "AFINN" "-2") ("exaggerates" "NA" "AFINN" "-2") ("exaggerating" "NA" "AFINN" "-2") ("exasperated" "NA" "AFINN" "2") ("excellence" "NA" "AFINN" "3") ("excellent" "NA" "AFINN" "3") ("excite" "NA" "AFINN" "3") ("excited" "NA" "AFINN" "3") ("excitement" "NA" "AFINN" "3") ("exciting" "NA" "AFINN" "3") ("exclude" "NA" "AFINN" "-1") ("excluded" "NA" "AFINN" "-2") ("exclusion" "NA" "AFINN" "-1") ("exclusive" "NA" "AFINN" "2") ("excuse" "NA" "AFINN" "-1") ("exempt" "NA" "AFINN" "-1") ("exhausted" "NA" "AFINN" "-2") ("exhilarated" "NA" "AFINN" "3") ("exhilarates" "NA" "AFINN" "3") ("exhilarating" "NA" "AFINN" "3") ("exonerate" "NA" "AFINN" "2") ("exonerated" "NA" "AFINN" "2") ("exonerates" "NA" "AFINN" "2") ("exonerating" "NA" "AFINN" "2") ("expand" "NA" "AFINN" "1") ("expands" "NA" "AFINN" "1") ("expel" "NA" "AFINN" "-2") ("expelled" "NA" "AFINN" "-2") ("expelling" "NA" "AFINN" "-2") ("expels" "NA" "AFINN" "-2") ("exploit" "NA" "AFINN" "-2") ("exploited" "NA" "AFINN" "-2") ("exploiting" "NA" "AFINN" "-2") ("exploits" "NA" "AFINN" "-2") ("exploration" "NA" "AFINN" "1") ("explorations" "NA" "AFINN" "1") ("expose" "NA" "AFINN" "-1") ("exposed" "NA" "AFINN" "-1") ("exposes" "NA" "AFINN" "-1") ("exposing" "NA" "AFINN" "-1") ("extend" "NA" "AFINN" "1") ("extends" "NA" "AFINN" "1") ("exuberant" "NA" "AFINN" "4") ("exultant" "NA" "AFINN" "3") ("exultantly" "NA" "AFINN" "3") ("fabulous" "NA" "AFINN" "4") ("fad" "NA" "AFINN" "-2") ("fag" "NA" "AFINN" "-3") ("faggot" "NA" "AFINN" "-3") ("faggots" "NA" "AFINN" "-3") ("fail" "NA" "AFINN" "-2") ("failed" "NA" "AFINN" "-2") ("failing" "NA" "AFINN" "-2") ("fails" "NA" "AFINN" "-2") ("failure" "NA" "AFINN" "-2") ("failures" "NA" "AFINN" "-2") ("fainthearted" "NA" "AFINN" "-2") ("fair" "NA" "AFINN" "2") ("faith" "NA" "AFINN" "1") ("faithful" "NA" "AFINN" "3") ("fake" "NA" "AFINN" "-3") ("fakes" "NA" "AFINN" "-3") ("faking" "NA" "AFINN" "-3") ("fallen" "NA" "AFINN" "-2") ("falling" "NA" "AFINN" "-1") ("falsified" "NA" "AFINN" "-3") ("falsify" "NA" "AFINN" "-3") ("fame" "NA" "AFINN" "1") ("fan" "NA" "AFINN" "3") ("fantastic" "NA" "AFINN" "4") ("farce" "NA" "AFINN" "-1") ("fascinate" "NA" "AFINN" "3") ("fascinated" "NA" "AFINN" "3") ("fascinates" "NA" "AFINN" "3") ("fascinating" "NA" "AFINN" "3") ("fascist" "NA" "AFINN" "-2") ("fascists" "NA" "AFINN" "-2") ("fatalities" "NA" "AFINN" "-3") ("fatality" "NA" "AFINN" "-3") ("fatigue" "NA" "AFINN" "-2") ("fatigued" "NA" "AFINN" "-2") ("fatigues" "NA" "AFINN" "-2") ("fatiguing" "NA" "AFINN" "-2") ("favor" "NA" "AFINN" "2") ("favored" "NA" "AFINN" "2") ("favorite" "NA" "AFINN" "2") ("favorited" "NA" "AFINN" "2") ("favorites" "NA" "AFINN" "2") ("favors" "NA" "AFINN" "2") ("fear" "NA" "AFINN" "-2") ("fearful" "NA" "AFINN" "-2") ("fearing" "NA" "AFINN" "-2") ("fearless" "NA" "AFINN" "2") ("fearsome" "NA" "AFINN" "-2") ("fed up" "NA" "AFINN" "-3") ("feeble" "NA" "AFINN" "-2") ("feeling" "NA" "AFINN" "1") ("felonies" "NA" "AFINN" "-3") ("felony" "NA" "AFINN" "-3") ("fervent" "NA" "AFINN" "2") ("fervid" "NA" "AFINN" "2") ("festive" "NA" "AFINN" "2") ("fiasco" "NA" "AFINN" "-3") ("fidgety" "NA" "AFINN" "-2") ("fight" "NA" "AFINN" "-1") ("fine" "NA" "AFINN" "2") ("fire" "NA" "AFINN" "-2") ("fired" "NA" "AFINN" "-2") ("firing" "NA" "AFINN" "-2") ("fit" "NA" "AFINN" "1") ("fitness" "NA" "AFINN" "1") ("flagship" "NA" "AFINN" "2") ("flees" "NA" "AFINN" "-1") ("flop" "NA" "AFINN" "-2") ("flops" "NA" "AFINN" "-2") ("flu" "NA" "AFINN" "-2") ("flustered" "NA" "AFINN" "-2") ("focused" "NA" "AFINN" "2") ("fond" "NA" "AFINN" "2") ("fondness" "NA" "AFINN" "2") ("fool" "NA" "AFINN" "-2") ("foolish" "NA" "AFINN" "-2") ("fools" "NA" "AFINN" "-2") ("forced" "NA" "AFINN" "-1") ("foreclosure" "NA" "AFINN" "-2") ("foreclosures" "NA" "AFINN" "-2") ("forget" "NA" "AFINN" "-1") ("forgetful" "NA" "AFINN" "-2") ("forgive" "NA" "AFINN" "1") ("forgiving" "NA" "AFINN" "1") ("forgotten" "NA" "AFINN" "-1") ("fortunate" "NA" "AFINN" "2") ("frantic" "NA" "AFINN" "-1") ("fraud" "NA" "AFINN" "-4") ("frauds" "NA" "AFINN" "-4") ("fraudster" "NA" "AFINN" "-4") ("fraudsters" "NA" "AFINN" "-4") ("fraudulence" "NA" "AFINN" "-4") ("fraudulent" "NA" "AFINN" "-4") ("free" "NA" "AFINN" "1") ("freedom" "NA" "AFINN" "2") ("frenzy" "NA" "AFINN" "-3") ("fresh" "NA" "AFINN" "1") ("friendly" "NA" "AFINN" "2") ("fright" "NA" "AFINN" "-2") ("frightened" "NA" "AFINN" "-2") ("frightening" "NA" "AFINN" "-3") ("frikin" "NA" "AFINN" "-2") ("frisky" "NA" "AFINN" "2") ("frowning" "NA" "AFINN" "-1") ("frustrate" "NA" "AFINN" "-2") ("frustrated" "NA" "AFINN" "-2") ("frustrates" "NA" "AFINN" "-2") ("frustrating" "NA" "AFINN" "-2") ("frustration" "NA" "AFINN" "-2") ("ftw" "NA" "AFINN" "3") ("fuck" "NA" "AFINN" "-4") ("fucked" "NA" "AFINN" "-4") ("fucker" "NA" "AFINN" "-4") ("fuckers" "NA" "AFINN" "-4") ("fuckface" "NA" "AFINN" "-4") ("fuckhead" "NA" "AFINN" "-4") ("fucking" "NA" "AFINN" "-4") ("fucktard" "NA" "AFINN" "-4") ("fud" "NA" "AFINN" "-3") ("fuked" "NA" "AFINN" "-4") ("fuking" "NA" "AFINN" "-4") ("fulfill" "NA" "AFINN" "2") ("fulfilled" "NA" "AFINN" "2") ("fulfills" "NA" "AFINN" "2") ("fuming" "NA" "AFINN" "-2") ("fun" "NA" "AFINN" "4") ("funeral" "NA" "AFINN" "-1") ("funerals" "NA" "AFINN" "-1") ("funky" "NA" "AFINN" "2") ("funnier" "NA" "AFINN" "4") ("funny" "NA" "AFINN" "4") ("furious" "NA" "AFINN" "-3") ("futile" "NA" "AFINN" "2") ("gag" "NA" "AFINN" "-2") ("gagged" "NA" "AFINN" "-2") ("gain" "NA" "AFINN" "2") ("gained" "NA" "AFINN" "2") ("gaining" "NA" "AFINN" "2") ("gains" "NA" "AFINN" "2") ("gallant" "NA" "AFINN" "3") ("gallantly" "NA" "AFINN" "3") ("gallantry" "NA" "AFINN" "3") ("generous" "NA" "AFINN" "2") ("genial" "NA" "AFINN" "3") ("ghost" "NA" "AFINN" "-1") ("giddy" "NA" "AFINN" "-2") ("gift" "NA" "AFINN" "2") ("glad" "NA" "AFINN" "3") ("glamorous" "NA" "AFINN" "3") ("glamourous" "NA" "AFINN" "3") ("glee" "NA" "AFINN" "3") ("gleeful" "NA" "AFINN" "3") ("gloom" "NA" "AFINN" "-1") ("gloomy" "NA" "AFINN" "-2") ("glorious" "NA" "AFINN" "2") ("glory" "NA" "AFINN" "2") ("glum" "NA" "AFINN" "-2") ("god" "NA" "AFINN" "1") ("goddamn" "NA" "AFINN" "-3") ("godsend" "NA" "AFINN" "4") ("good" "NA" "AFINN" "3") ("goodness" "NA" "AFINN" "3") ("grace" "NA" "AFINN" "1") ("gracious" "NA" "AFINN" "3") ("grand" "NA" "AFINN" "3") ("grant" "NA" "AFINN" "1") ("granted" "NA" "AFINN" "1") ("granting" "NA" "AFINN" "1") ("grants" "NA" "AFINN" "1") ("grateful" "NA" "AFINN" "3") ("gratification" "NA" "AFINN" "2") ("grave" "NA" "AFINN" "-2") ("gray" "NA" "AFINN" "-1") ("great" "NA" "AFINN" "3") ("greater" "NA" "AFINN" "3") ("greatest" "NA" "AFINN" "3") ("greed" "NA" "AFINN" "-3") ("greedy" "NA" "AFINN" "-2") ("green wash" "NA" "AFINN" "-3") ("green washing" "NA" "AFINN" "-3") ("greenwash" "NA" "AFINN" "-3") ("greenwasher" "NA" "AFINN" "-3") ("greenwashers" "NA" "AFINN" "-3") ("greenwashing" "NA" "AFINN" "-3") ("greet" "NA" "AFINN" "1") ("greeted" "NA" "AFINN" "1") ("greeting" "NA" "AFINN" "1") ("greetings" "NA" "AFINN" "2") ("greets" "NA" "AFINN" "1") ("grey" "NA" "AFINN" "-1") ("grief" "NA" "AFINN" "-2") ("grieved" "NA" "AFINN" "-2") ("gross" "NA" "AFINN" "-2") ("growing" "NA" "AFINN" "1") ("growth" "NA" "AFINN" "2") ("guarantee" "NA" "AFINN" "1") ("guilt" "NA" "AFINN" "-3") ("guilty" "NA" "AFINN" "-3") ("gullibility" "NA" "AFINN" "-2") ("gullible" "NA" "AFINN" "-2") ("gun" "NA" "AFINN" "-1") ("ha" "NA" "AFINN" "2") ("hacked" "NA" "AFINN" "-1") ("haha" "NA" "AFINN" "3") ("hahaha" "NA" "AFINN" "3") ("hahahah" "NA" "AFINN" "3") ("hail" "NA" "AFINN" "2") ("hailed" "NA" "AFINN" "2") ("hapless" "NA" "AFINN" "-2") ("haplessness" "NA" "AFINN" "-2") ("happiness" "NA" "AFINN" "3") ("happy" "NA" "AFINN" "3") ("hard" "NA" "AFINN" "-1") ("hardier" "NA" "AFINN" "2") ("hardship" "NA" "AFINN" "-2") ("hardy" "NA" "AFINN" "2") ("harm" "NA" "AFINN" "-2") ("harmed" "NA" "AFINN" "-2") ("harmful" "NA" "AFINN" "-2") ("harming" "NA" "AFINN" "-2") ("harms" "NA" "AFINN" "-2") ("harried" "NA" "AFINN" "-2") ("harsh" "NA" "AFINN" "-2") ("harsher" "NA" "AFINN" "-2") ("harshest" "NA" "AFINN" "-2") ("hate" "NA" "AFINN" "-3") ("hated" "NA" "AFINN" "-3") ("haters" "NA" "AFINN" "-3") ("hates" "NA" "AFINN" "-3") ("hating" "NA" "AFINN" "-3") ("haunt" "NA" "AFINN" "-1") ("haunted" "NA" "AFINN" "-2") ("haunting" "NA" "AFINN" "1") ("haunts" "NA" "AFINN" "-1") ("havoc" "NA" "AFINN" "-2") ("healthy" "NA" "AFINN" "2") ("heartbreaking" "NA" "AFINN" "-3") ("heartbroken" "NA" "AFINN" "-3") ("heartfelt" "NA" "AFINN" "3") ("heaven" "NA" "AFINN" "2") ("heavenly" "NA" "AFINN" "4") ("heavyhearted" "NA" "AFINN" "-2") ("hell" "NA" "AFINN" "-4") ("help" "NA" "AFINN" "2") ("helpful" "NA" "AFINN" "2") ("helping" "NA" "AFINN" "2") ("helpless" "NA" "AFINN" "-2") ("helps" "NA" "AFINN" "2") ("hero" "NA" "AFINN" "2") ("heroes" "NA" "AFINN" "2") ("heroic" "NA" "AFINN" "3") ("hesitant" "NA" "AFINN" "-2") ("hesitate" "NA" "AFINN" "-2") ("hid" "NA" "AFINN" "-1") ("hide" "NA" "AFINN" "-1") ("hides" "NA" "AFINN" "-1") ("hiding" "NA" "AFINN" "-1") ("highlight" "NA" "AFINN" "2") ("hilarious" "NA" "AFINN" "2") ("hindrance" "NA" "AFINN" "-2") ("hoax" "NA" "AFINN" "-2") ("homesick" "NA" "AFINN" "-2") ("honest" "NA" "AFINN" "2") ("honor" "NA" "AFINN" "2") ("honored" "NA" "AFINN" "2") ("honoring" "NA" "AFINN" "2") ("honour" "NA" "AFINN" "2") ("honoured" "NA" "AFINN" "2") ("honouring" "NA" "AFINN" "2") ("hooligan" "NA" "AFINN" "-2") ("hooliganism" "NA" "AFINN" "-2") ("hooligans" "NA" "AFINN" "-2") ("hope" "NA" "AFINN" "2") ("hopeful" "NA" "AFINN" "2") ("hopefully" "NA" "AFINN" "2") ("hopeless" "NA" "AFINN" "-2") ("hopelessness" "NA" "AFINN" "-2") ("hopes" "NA" "AFINN" "2") ("hoping" "NA" "AFINN" "2") ("horrendous" "NA" "AFINN" "-3") ("horrible" "NA" "AFINN" "-3") ("horrific" "NA" "AFINN" "-3") ("horrified" "NA" "AFINN" "-3") ("hostile" "NA" "AFINN" "-2") ("huckster" "NA" "AFINN" "-2") ("hug" "NA" "AFINN" "2") ("huge" "NA" "AFINN" "1") ("hugs" "NA" "AFINN" "2") ("humerous" "NA" "AFINN" "3") ("humiliated" "NA" "AFINN" "-3") ("humiliation" "NA" "AFINN" "-3") ("humor" "NA" "AFINN" "2") ("humorous" "NA" "AFINN" "2") ("humour" "NA" "AFINN" "2") ("humourous" "NA" "AFINN" "2") ("hunger" "NA" "AFINN" "-2") ("hurrah" "NA" "AFINN" "5") ("hurt" "NA" "AFINN" "-2") ("hurting" "NA" "AFINN" "-2") ("hurts" "NA" "AFINN" "-2") ("hypocritical" "NA" "AFINN" "-2") ("hysteria" "NA" "AFINN" "-3") ("hysterical" "NA" "AFINN" "-3") ("hysterics" "NA" "AFINN" "-3") ("idiot" "NA" "AFINN" "-3") ("idiotic" "NA" "AFINN" "-3") ("ignorance" "NA" "AFINN" "-2") ("ignorant" "NA" "AFINN" "-2") ("ignore" "NA" "AFINN" "-1") ("ignored" "NA" "AFINN" "-2") ("ignores" "NA" "AFINN" "-1") ("ill" "NA" "AFINN" "-2") ("illegal" "NA" "AFINN" "-3") ("illiteracy" "NA" "AFINN" "-2") ("illness" "NA" "AFINN" "-2") ("illnesses" "NA" "AFINN" "-2") ("imbecile" "NA" "AFINN" "-3") ("immobilized" "NA" "AFINN" "-1") ("immortal" "NA" "AFINN" "2") ("immune" "NA" "AFINN" "1") ("impatient" "NA" "AFINN" "-2") ("imperfect" "NA" "AFINN" "-2") ("importance" "NA" "AFINN" "2") ("important" "NA" "AFINN" "2") ("impose" "NA" "AFINN" "-1") ("imposed" "NA" "AFINN" "-1") ("imposes" "NA" "AFINN" "-1") ("imposing" "NA" "AFINN" "-1") ("impotent" "NA" "AFINN" "-2") ("impress" "NA" "AFINN" "3") ("impressed" "NA" "AFINN" "3") ("impresses" "NA" "AFINN" "3") ("impressive" "NA" "AFINN" "3") ("imprisoned" "NA" "AFINN" "-2") ("improve" "NA" "AFINN" "2") ("improved" "NA" "AFINN" "2") ("improvement" "NA" "AFINN" "2") ("improves" "NA" "AFINN" "2") ("improving" "NA" "AFINN" "2") ("inability" "NA" "AFINN" "-2") ("inaction" "NA" "AFINN" "-2") ("inadequate" "NA" "AFINN" "-2") ("incapable" "NA" "AFINN" "-2") ("incapacitated" "NA" "AFINN" "-2") ("incensed" "NA" "AFINN" "-2") ("incompetence" "NA" "AFINN" "-2") ("incompetent" "NA" "AFINN" "-2") ("inconsiderate" "NA" "AFINN" "-2") ("inconvenience" "NA" "AFINN" "-2") ("inconvenient" "NA" "AFINN" "-2") ("increase" "NA" "AFINN" "1") ("increased" "NA" "AFINN" "1") ("indecisive" "NA" "AFINN" "-2") ("indestructible" "NA" "AFINN" "2") ("indifference" "NA" "AFINN" "-2") ("indifferent" "NA" "AFINN" "-2") ("indignant" "NA" "AFINN" "-2") ("indignation" "NA" "AFINN" "-2") ("indoctrinate" "NA" "AFINN" "-2") ("indoctrinated" "NA" "AFINN" "-2") ("indoctrinates" "NA" "AFINN" "-2") ("indoctrinating" "NA" "AFINN" "-2") ("ineffective" "NA" "AFINN" "-2") ("ineffectively" "NA" "AFINN" "-2") ("infatuated" "NA" "AFINN" "2") ("infatuation" "NA" "AFINN" "2") ("infected" "NA" "AFINN" "-2") ("inferior" "NA" "AFINN" "-2") ("inflamed" "NA" "AFINN" "-2") ("influential" "NA" "AFINN" "2") ("infringement" "NA" "AFINN" "-2") ("infuriate" "NA" "AFINN" "-2") ("infuriated" "NA" "AFINN" "-2") ("infuriates" "NA" "AFINN" "-2") ("infuriating" "NA" "AFINN" "-2") ("inhibit" "NA" "AFINN" "-1") ("injured" "NA" "AFINN" "-2") ("injury" "NA" "AFINN" "-2") ("injustice" "NA" "AFINN" "-2") ("innovate" "NA" "AFINN" "1") ("innovates" "NA" "AFINN" "1") ("innovation" "NA" "AFINN" "1") ("innovative" "NA" "AFINN" "2") ("inquisition" "NA" "AFINN" "-2") ("inquisitive" "NA" "AFINN" "2") ("insane" "NA" "AFINN" "-2") ("insanity" "NA" "AFINN" "-2") ("insecure" "NA" "AFINN" "-2") ("insensitive" "NA" "AFINN" "-2") ("insensitivity" "NA" "AFINN" "-2") ("insignificant" "NA" "AFINN" "-2") ("insipid" "NA" "AFINN" "-2") ("inspiration" "NA" "AFINN" "2") ("inspirational" "NA" "AFINN" "2") ("inspire" "NA" "AFINN" "2") ("inspired" "NA" "AFINN" "2") ("inspires" "NA" "AFINN" "2") ("inspiring" "NA" "AFINN" "3") ("insult" "NA" "AFINN" "-2") ("insulted" "NA" "AFINN" "-2") ("insulting" "NA" "AFINN" "-2") ("insults" "NA" "AFINN" "-2") ("intact" "NA" "AFINN" "2") ("integrity" "NA" "AFINN" "2") ("intelligent" "NA" "AFINN" "2") ("intense" "NA" "AFINN" "1") ("interest" "NA" "AFINN" "1") ("interested" "NA" "AFINN" "2") ("interesting" "NA" "AFINN" "2") ("interests" "NA" "AFINN" "1") ("interrogated" "NA" "AFINN" "-2") ("interrupt" "NA" "AFINN" "-2") ("interrupted" "NA" "AFINN" "-2") ("interrupting" "NA" "AFINN" "-2") ("interruption" "NA" "AFINN" "-2") ("interrupts" "NA" "AFINN" "-2") ("intimidate" "NA" "AFINN" "-2") ("intimidated" "NA" "AFINN" "-2") ("intimidates" "NA" "AFINN" "-2") ("intimidating" "NA" "AFINN" "-2") ("intimidation" "NA" "AFINN" "-2") ("intricate" "NA" "AFINN" "2") ("intrigues" "NA" "AFINN" "1") ("invincible" "NA" "AFINN" "2") ("invite" "NA" "AFINN" "1") ("inviting" "NA" "AFINN" "1") ("invulnerable" "NA" "AFINN" "2") ("irate" "NA" "AFINN" "-3") ("ironic" "NA" "AFINN" "-1") ("irony" "NA" "AFINN" "-1") ("irrational" "NA" "AFINN" "-1") ("irresistible" "NA" "AFINN" "2") ("irresolute" "NA" "AFINN" "-2") ("irresponsible" "NA" "AFINN" "2") ("irreversible" "NA" "AFINN" "-1") ("irritate" "NA" "AFINN" "-3") ("irritated" "NA" "AFINN" "-3") ("irritating" "NA" "AFINN" "-3") ("isolated" "NA" "AFINN" "-1") ("itchy" "NA" "AFINN" "-2") ("jackass" "NA" "AFINN" "-4") ("jackasses" "NA" "AFINN" "-4") ("jailed" "NA" "AFINN" "-2") ("jaunty" "NA" "AFINN" "2") ("jealous" "NA" "AFINN" "-2") ("jeopardy" "NA" "AFINN" "-2") ("jerk" "NA" "AFINN" "-3") ("jesus" "NA" "AFINN" "1") ("jewel" "NA" "AFINN" "1") ("jewels" "NA" "AFINN" "1") ("jocular" "NA" "AFINN" "2") ("join" "NA" "AFINN" "1") ("joke" "NA" "AFINN" "2") ("jokes" "NA" "AFINN" "2") ("jolly" "NA" "AFINN" "2") ("jovial" "NA" "AFINN" "2") ("joy" "NA" "AFINN" "3") ("joyful" "NA" "AFINN" "3") ("joyfully" "NA" "AFINN" "3") ("joyless" "NA" "AFINN" "-2") ("joyous" "NA" "AFINN" "3") ("jubilant" "NA" "AFINN" "3") ("jumpy" "NA" "AFINN" "-1") ("justice" "NA" "AFINN" "2") ("justifiably" "NA" "AFINN" "2") ("justified" "NA" "AFINN" "2") ("keen" "NA" "AFINN" "1") ("kill" "NA" "AFINN" "-3") ("killed" "NA" "AFINN" "-3") ("killing" "NA" "AFINN" "-3") ("kills" "NA" "AFINN" "-3") ("kind" "NA" "AFINN" "2") ("kinder" "NA" "AFINN" "2") ("kiss" "NA" "AFINN" "2") ("kudos" "NA" "AFINN" "3") ("lack" "NA" "AFINN" "-2") ("lackadaisical" "NA" "AFINN" "-2") ("lag" "NA" "AFINN" "-1") ("lagged" "NA" "AFINN" "-2") ("lagging" "NA" "AFINN" "-2") ("lags" "NA" "AFINN" "-2") ("lame" "NA" "AFINN" "-2") ("landmark" "NA" "AFINN" "2") ("laugh" "NA" "AFINN" "1") ("laughed" "NA" "AFINN" "1") ("laughing" "NA" "AFINN" "1") ("laughs" "NA" "AFINN" "1") ("laughting" "NA" "AFINN" "1") ("launched" "NA" "AFINN" "1") ("lawl" "NA" "AFINN" "3") ("lawsuit" "NA" "AFINN" "-2") ("lawsuits" "NA" "AFINN" "-2") ("lazy" "NA" "AFINN" "-1") ("leak" "NA" "AFINN" "-1") ("leaked" "NA" "AFINN" "-1") ("leave" "NA" "AFINN" "-1") ("legal" "NA" "AFINN" "1") ("legally" "NA" "AFINN" "1") ("lenient" "NA" "AFINN" "1") ("lethargic" "NA" "AFINN" "-2") ("lethargy" "NA" "AFINN" "-2") ("liar" "NA" "AFINN" "-3") ("liars" "NA" "AFINN" "-3") ("libelous" "NA" "AFINN" "-2") ("lied" "NA" "AFINN" "-2") ("lifesaver" "NA" "AFINN" "4") ("lighthearted" "NA" "AFINN" "1") ("like" "NA" "AFINN" "2") ("liked" "NA" "AFINN" "2") ("likes" "NA" "AFINN" "2") ("limitation" "NA" "AFINN" "-1") ("limited" "NA" "AFINN" "-1") ("limits" "NA" "AFINN" "-1") ("litigation" "NA" "AFINN" "-1") ("litigious" "NA" "AFINN" "-2") ("lively" "NA" "AFINN" "2") ("livid" "NA" "AFINN" "-2") ("lmao" "NA" "AFINN" "4") ("lmfao" "NA" "AFINN" "4") ("loathe" "NA" "AFINN" "-3") ("loathed" "NA" "AFINN" "-3") ("loathes" "NA" "AFINN" "-3") ("loathing" "NA" "AFINN" "-3") ("lobby" "NA" "AFINN" "-2") ("lobbying" "NA" "AFINN" "-2") ("lol" "NA" "AFINN" "3") ("lonely" "NA" "AFINN" "-2") ("lonesome" "NA" "AFINN" "-2") ("longing" "NA" "AFINN" "-1") ("loom" "NA" "AFINN" "-1") ("loomed" "NA" "AFINN" "-1") ("looming" "NA" "AFINN" "-1") ("looms" "NA" "AFINN" "-1") ("loose" "NA" "AFINN" "-3") ("looses" "NA" "AFINN" "-3") ("loser" "NA" "AFINN" "-3") ("losing" "NA" "AFINN" "-3") ("loss" "NA" "AFINN" "-3") ("lost" "NA" "AFINN" "-3") ("lovable" "NA" "AFINN" "3") ("love" "NA" "AFINN" "3") ("loved" "NA" "AFINN" "3") ("lovelies" "NA" "AFINN" "3") ("lovely" "NA" "AFINN" "3") ("loving" "NA" "AFINN" "2") ("lowest" "NA" "AFINN" "-1") ("loyal" "NA" "AFINN" "3") ("loyalty" "NA" "AFINN" "3") ("luck" "NA" "AFINN" "3") ("luckily" "NA" "AFINN" "3") ("lucky" "NA" "AFINN" "3") ("lugubrious" "NA" "AFINN" "-2") ("lunatic" "NA" "AFINN" "-3") ("lunatics" "NA" "AFINN" "-3") ("lurk" "NA" "AFINN" "-1") ("lurking" "NA" "AFINN" "-1") ("lurks" "NA" "AFINN" "-1") ("mad" "NA" "AFINN" "-3") ("maddening" "NA" "AFINN" "-3") ("made-up" "NA" "AFINN" "-1") ("madly" "NA" "AFINN" "-3") ("madness" "NA" "AFINN" "-3") ("mandatory" "NA" "AFINN" "-1") ("manipulated" "NA" "AFINN" "-1") ("manipulating" "NA" "AFINN" "-1") ("manipulation" "NA" "AFINN" "-1") ("marvel" "NA" "AFINN" "3") ("marvelous" "NA" "AFINN" "3") ("marvels" "NA" "AFINN" "3") ("masterpiece" "NA" "AFINN" "4") ("masterpieces" "NA" "AFINN" "4") ("matter" "NA" "AFINN" "1") ("matters" "NA" "AFINN" "1") ("mature" "NA" "AFINN" "2") ("meaningful" "NA" "AFINN" "2") ("meaningless" "NA" "AFINN" "-2") ("medal" "NA" "AFINN" "3") ("mediocrity" "NA" "AFINN" "-3") ("meditative" "NA" "AFINN" "1") ("melancholy" "NA" "AFINN" "-2") ("menace" "NA" "AFINN" "-2") ("menaced" "NA" "AFINN" "-2") ("mercy" "NA" "AFINN" "2") ("merry" "NA" "AFINN" "3") ("mess" "NA" "AFINN" "-2") ("messed" "NA" "AFINN" "-2") ("messing up" "NA" "AFINN" "-2") ("methodical" "NA" "AFINN" "2") ("mindless" "NA" "AFINN" "-2") ("miracle" "NA" "AFINN" "4") ("mirth" "NA" "AFINN" "3") ("mirthful" "NA" "AFINN" "3") ("mirthfully" "NA" "AFINN" "3") ("misbehave" "NA" "AFINN" "-2") ("misbehaved" "NA" "AFINN" "-2") ("misbehaves" "NA" "AFINN" "-2") ("misbehaving" "NA" "AFINN" "-2") ("mischief" "NA" "AFINN" "-1") ("mischiefs" "NA" "AFINN" "-1") ("miserable" "NA" "AFINN" "-3") ("misery" "NA" "AFINN" "-2") ("misgiving" "NA" "AFINN" "-2") ("misinformation" "NA" "AFINN" "-2") ("misinformed" "NA" "AFINN" "-2") ("misinterpreted" "NA" "AFINN" "-2") ("misleading" "NA" "AFINN" "-3") ("misread" "NA" "AFINN" "-1") ("misreporting" "NA" "AFINN" "-2") ("misrepresentation" "NA" "AFINN" "-2") ("miss" "NA" "AFINN" "-2") ("missed" "NA" "AFINN" "-2") ("missing" "NA" "AFINN" "-2") ("mistake" "NA" "AFINN" "-2") ("mistaken" "NA" "AFINN" "-2") ("mistakes" "NA" "AFINN" "-2") ("mistaking" "NA" "AFINN" "-2") ("misunderstand" "NA" "AFINN" "-2") ("misunderstanding" "NA" "AFINN" "-2") ("misunderstands" "NA" "AFINN" "-2") ("misunderstood" "NA" "AFINN" "-2") ("moan" "NA" "AFINN" "-2") ("moaned" "NA" "AFINN" "-2") ("moaning" "NA" "AFINN" "-2") ("moans" "NA" "AFINN" "-2") ("mock" "NA" "AFINN" "-2") ("mocked" "NA" "AFINN" "-2") ("mocking" "NA" "AFINN" "-2") ("mocks" "NA" "AFINN" "-2") ("mongering" "NA" "AFINN" "-2") ("monopolize" "NA" "AFINN" "-2") ("monopolized" "NA" "AFINN" "-2") ("monopolizes" "NA" "AFINN" "-2") ("monopolizing" "NA" "AFINN" "-2") ("moody" "NA" "AFINN" "-1") ("mope" "NA" "AFINN" "-1") ("moping" "NA" "AFINN" "-1") ("moron" "NA" "AFINN" "-3") ("motherfucker" "NA" "AFINN" "-5") ("motherfucking" "NA" "AFINN" "-5") ("motivate" "NA" "AFINN" "1") ("motivated" "NA" "AFINN" "2") ("motivating" "NA" "AFINN" "2") ("motivation" "NA" "AFINN" "1") ("mourn" "NA" "AFINN" "-2") ("mourned" "NA" "AFINN" "-2") ("mournful" "NA" "AFINN" "-2") ("mourning" "NA" "AFINN" "-2") ("mourns" "NA" "AFINN" "-2") ("mumpish" "NA" "AFINN" "-2") ("murder" "NA" "AFINN" "-2") ("murderer" "NA" "AFINN" "-2") ("murdering" "NA" "AFINN" "-3") ("murderous" "NA" "AFINN" "-3") ("murders" "NA" "AFINN" "-2") ("myth" "NA" "AFINN" "-1") ("n00b" "NA" "AFINN" "-2") ("naive" "NA" "AFINN" "-2") ("nasty" "NA" "AFINN" "-3") ("natural" "NA" "AFINN" "1") ("needy" "NA" "AFINN" "-2") ("negative" "NA" "AFINN" "-2") ("negativity" "NA" "AFINN" "-2") ("neglect" "NA" "AFINN" "-2") ("neglected" "NA" "AFINN" "-2") ("neglecting" "NA" "AFINN" "-2") ("neglects" "NA" "AFINN" "-2") ("nerves" "NA" "AFINN" "-1") ("nervous" "NA" "AFINN" "-2") ("nervously" "NA" "AFINN" "-2") ("nice" "NA" "AFINN" "3") ("nifty" "NA" "AFINN" "2") ("niggas" "NA" "AFINN" "-5") ("nigger" "NA" "AFINN" "-5") ("no" "NA" "AFINN" "-1") ("no fun" "NA" "AFINN" "-3") ("noble" "NA" "AFINN" "2") ("noisy" "NA" "AFINN" "-1") ("nonsense" "NA" "AFINN" "-2") ("noob" "NA" "AFINN" "-2") ("nosey" "NA" "AFINN" "-2") ("not good" "NA" "AFINN" "-2") ("not working" "NA" "AFINN" "-3") ("notorious" "NA" "AFINN" "-2") ("novel" "NA" "AFINN" "2") ("numb" "NA" "AFINN" "-1") ("nuts" "NA" "AFINN" "-3") ("obliterate" "NA" "AFINN" "-2") ("obliterated" "NA" "AFINN" "-2") ("obnoxious" "NA" "AFINN" "-3") ("obscene" "NA" "AFINN" "-2") ("obsessed" "NA" "AFINN" "2") ("obsolete" "NA" "AFINN" "-2") ("obstacle" "NA" "AFINN" "-2") ("obstacles" "NA" "AFINN" "-2") ("obstinate" "NA" "AFINN" "-2") ("odd" "NA" "AFINN" "-2") ("offend" "NA" "AFINN" "-2") ("offended" "NA" "AFINN" "-2") ("offender" "NA" "AFINN" "-2") ("offending" "NA" "AFINN" "-2") ("offends" "NA" "AFINN" "-2") ("offline" "NA" "AFINN" "-1") ("oks" "NA" "AFINN" "2") ("ominous" "NA" "AFINN" "3") ("once-in-a-lifetime" "NA" "AFINN" "3") ("opportunities" "NA" "AFINN" "2") ("opportunity" "NA" "AFINN" "2") ("oppressed" "NA" "AFINN" "-2") ("oppressive" "NA" "AFINN" "-2") ("optimism" "NA" "AFINN" "2") ("optimistic" "NA" "AFINN" "2") ("optionless" "NA" "AFINN" "-2") ("outcry" "NA" "AFINN" "-2") ("outmaneuvered" "NA" "AFINN" "-2") ("outrage" "NA" "AFINN" "-3") ("outraged" "NA" "AFINN" "-3") ("outreach" "NA" "AFINN" "2") ("outstanding" "NA" "AFINN" "5") ("overjoyed" "NA" "AFINN" "4") ("overload" "NA" "AFINN" "-1") ("overlooked" "NA" "AFINN" "-1") ("overreact" "NA" "AFINN" "-2") ("overreacted" "NA" "AFINN" "-2") ("overreaction" "NA" "AFINN" "-2") ("overreacts" "NA" "AFINN" "-2") ("oversell" "NA" "AFINN" "-2") ("overselling" "NA" "AFINN" "-2") ("oversells" "NA" "AFINN" "-2") ("oversimplification" "NA" "AFINN" "-2") ("oversimplified" "NA" "AFINN" "-2") ("oversimplifies" "NA" "AFINN" "-2") ("oversimplify" "NA" "AFINN" "-2") ("overstatement" "NA" "AFINN" "-2") ("overstatements" "NA" "AFINN" "-2") ("overweight" "NA" "AFINN" "-1") ("oxymoron" "NA" "AFINN" "-1") ("pain" "NA" "AFINN" "-2") ("pained" "NA" "AFINN" "-2") ("panic" "NA" "AFINN" "-3") ("panicked" "NA" "AFINN" "-3") ("panics" "NA" "AFINN" "-3") ("paradise" "NA" "AFINN" "3") ("paradox" "NA" "AFINN" "-1") ("pardon" "NA" "AFINN" "2") ("pardoned" "NA" "AFINN" "2") ("pardoning" "NA" "AFINN" "2") ("pardons" "NA" "AFINN" "2") ("parley" "NA" "AFINN" "-1") ("passionate" "NA" "AFINN" "2") ("passive" "NA" "AFINN" "-1") ("passively" "NA" "AFINN" "-1") ("pathetic" "NA" "AFINN" "-2") ("pay" "NA" "AFINN" "-1") ("peace" "NA" "AFINN" "2") ("peaceful" "NA" "AFINN" "2") ("peacefully" "NA" "AFINN" "2") ("penalty" "NA" "AFINN" "-2") ("pensive" "NA" "AFINN" "-1") ("perfect" "NA" "AFINN" "3") ("perfected" "NA" "AFINN" "2") ("perfectly" "NA" "AFINN" "3") ("perfects" "NA" "AFINN" "2") ("peril" "NA" "AFINN" "-2") ("perjury" "NA" "AFINN" "-3") ("perpetrator" "NA" "AFINN" "-2") ("perpetrators" "NA" "AFINN" "-2") ("perplexed" "NA" "AFINN" "-2") ("persecute" "NA" "AFINN" "-2") ("persecuted" "NA" "AFINN" "-2") ("persecutes" "NA" "AFINN" "-2") ("persecuting" "NA" "AFINN" "-2") ("perturbed" "NA" "AFINN" "-2") ("pesky" "NA" "AFINN" "-2") ("pessimism" "NA" "AFINN" "-2") ("pessimistic" "NA" "AFINN" "-2") ("petrified" "NA" "AFINN" "-2") ("phobic" "NA" "AFINN" "-2") ("picturesque" "NA" "AFINN" "2") ("pileup" "NA" "AFINN" "-1") ("pique" "NA" "AFINN" "-2") ("piqued" "NA" "AFINN" "-2") ("piss" "NA" "AFINN" "-4") ("pissed" "NA" "AFINN" "-4") ("pissing" "NA" "AFINN" "-3") ("piteous" "NA" "AFINN" "-2") ("pitied" "NA" "AFINN" "-1") ("pity" "NA" "AFINN" "-2") ("playful" "NA" "AFINN" "2") ("pleasant" "NA" "AFINN" "3") ("please" "NA" "AFINN" "1") ("pleased" "NA" "AFINN" "3") ("pleasure" "NA" "AFINN" "3") ("poised" "NA" "AFINN" "-2") ("poison" "NA" "AFINN" "-2") ("poisoned" "NA" "AFINN" "-2") ("poisons" "NA" "AFINN" "-2") ("pollute" "NA" "AFINN" "-2") ("polluted" "NA" "AFINN" "-2") ("polluter" "NA" "AFINN" "-2") ("polluters" "NA" "AFINN" "-2") ("pollutes" "NA" "AFINN" "-2") ("poor" "NA" "AFINN" "-2") ("poorer" "NA" "AFINN" "-2") ("poorest" "NA" "AFINN" "-2") ("popular" "NA" "AFINN" "3") ("positive" "NA" "AFINN" "2") ("positively" "NA" "AFINN" "2") ("possessive" "NA" "AFINN" "-2") ("postpone" "NA" "AFINN" "-1") ("postponed" "NA" "AFINN" "-1") ("postpones" "NA" "AFINN" "-1") ("postponing" "NA" "AFINN" "-1") ("poverty" "NA" "AFINN" "-1") ("powerful" "NA" "AFINN" "2") ("powerless" "NA" "AFINN" "-2") ("praise" "NA" "AFINN" "3") ("praised" "NA" "AFINN" "3") ("praises" "NA" "AFINN" "3") ("praising" "NA" "AFINN" "3") ("pray" "NA" "AFINN" "1") ("praying" "NA" "AFINN" "1") ("prays" "NA" "AFINN" "1") ("prblm" "NA" "AFINN" "-2") ("prblms" "NA" "AFINN" "-2") ("prepared" "NA" "AFINN" "1") ("pressure" "NA" "AFINN" "-1") ("pressured" "NA" "AFINN" "-2") ("pretend" "NA" "AFINN" "-1") ("pretending" "NA" "AFINN" "-1") ("pretends" "NA" "AFINN" "-1") ("pretty" "NA" "AFINN" "1") ("prevent" "NA" "AFINN" "-1") ("prevented" "NA" "AFINN" "-1") ("preventing" "NA" "AFINN" "-1") ("prevents" "NA" "AFINN" "-1") ("prick" "NA" "AFINN" "-5") ("prison" "NA" "AFINN" "-2") ("prisoner" "NA" "AFINN" "-2") ("prisoners" "NA" "AFINN" "-2") ("privileged" "NA" "AFINN" "2") ("proactive" "NA" "AFINN" "2") ("problem" "NA" "AFINN" "-2") ("problems" "NA" "AFINN" "-2") ("profiteer" "NA" "AFINN" "-2") ("progress" "NA" "AFINN" "2") ("prominent" "NA" "AFINN" "2") ("promise" "NA" "AFINN" "1") ("promised" "NA" "AFINN" "1") ("promises" "NA" "AFINN" "1") ("promote" "NA" "AFINN" "1") ("promoted" "NA" "AFINN" "1") ("promotes" "NA" "AFINN" "1") ("promoting" "NA" "AFINN" "1") ("propaganda" "NA" "AFINN" "-2") ("prosecute" "NA" "AFINN" "-1") ("prosecuted" "NA" "AFINN" "-2") ("prosecutes" "NA" "AFINN" "-1") ("prosecution" "NA" "AFINN" "-1") ("prospect" "NA" "AFINN" "1") ("prospects" "NA" "AFINN" "1") ("prosperous" "NA" "AFINN" "3") ("protect" "NA" "AFINN" "1") ("protected" "NA" "AFINN" "1") ("protects" "NA" "AFINN" "1") ("protest" "NA" "AFINN" "-2") ("protesters" "NA" "AFINN" "-2") ("protesting" "NA" "AFINN" "-2") ("protests" "NA" "AFINN" "-2") ("proud" "NA" "AFINN" "2") ("proudly" "NA" "AFINN" "2") ("provoke" "NA" "AFINN" "-1") ("provoked" "NA" "AFINN" "-1") ("provokes" "NA" "AFINN" "-1") ("provoking" "NA" "AFINN" "-1") ("pseudoscience" "NA" "AFINN" "-3") ("punish" "NA" "AFINN" "-2") ("punished" "NA" "AFINN" "-2") ("punishes" "NA" "AFINN" "-2") ("punitive" "NA" "AFINN" "-2") ("pushy" "NA" "AFINN" "-1") ("puzzled" "NA" "AFINN" "-2") ("quaking" "NA" "AFINN" "-2") ("questionable" "NA" "AFINN" "-2") ("questioned" "NA" "AFINN" "-1") ("questioning" "NA" "AFINN" "-1") ("racism" "NA" "AFINN" "-3") ("racist" "NA" "AFINN" "-3") ("racists" "NA" "AFINN" "-3") ("rage" "NA" "AFINN" "-2") ("rageful" "NA" "AFINN" "-2") ("rainy" "NA" "AFINN" "-1") ("rant" "NA" "AFINN" "-3") ("ranter" "NA" "AFINN" "-3") ("ranters" "NA" "AFINN" "-3") ("rants" "NA" "AFINN" "-3") ("rape" "NA" "AFINN" "-4") ("rapist" "NA" "AFINN" "-4") ("rapture" "NA" "AFINN" "2") ("raptured" "NA" "AFINN" "2") ("raptures" "NA" "AFINN" "2") ("rapturous" "NA" "AFINN" "4") ("rash" "NA" "AFINN" "-2") ("ratified" "NA" "AFINN" "2") ("reach" "NA" "AFINN" "1") ("reached" "NA" "AFINN" "1") ("reaches" "NA" "AFINN" "1") ("reaching" "NA" "AFINN" "1") ("reassure" "NA" "AFINN" "1") ("reassured" "NA" "AFINN" "1") ("reassures" "NA" "AFINN" "1") ("reassuring" "NA" "AFINN" "2") ("rebellion" "NA" "AFINN" "-2") ("recession" "NA" "AFINN" "-2") ("reckless" "NA" "AFINN" "-2") ("recommend" "NA" "AFINN" "2") ("recommended" "NA" "AFINN" "2") ("recommends" "NA" "AFINN" "2") ("redeemed" "NA" "AFINN" "2") ("refuse" "NA" "AFINN" "-2") ("refused" "NA" "AFINN" "-2") ("refusing" "NA" "AFINN" "-2") ("regret" "NA" "AFINN" "-2") ("regretful" "NA" "AFINN" "-2") ("regrets" "NA" "AFINN" "-2") ("regretted" "NA" "AFINN" "-2") ("regretting" "NA" "AFINN" "-2") ("reject" "NA" "AFINN" "-1") ("rejected" "NA" "AFINN" "-1") ("rejecting" "NA" "AFINN" "-1") ("rejects" "NA" "AFINN" "-1") ("rejoice" "NA" "AFINN" "4") ("rejoiced" "NA" "AFINN" "4") ("rejoices" "NA" "AFINN" "4") ("rejoicing" "NA" "AFINN" "4") ("relaxed" "NA" "AFINN" "2") ("relentless" "NA" "AFINN" "-1") ("reliant" "NA" "AFINN" "2") ("relieve" "NA" "AFINN" "1") ("relieved" "NA" "AFINN" "2") ("relieves" "NA" "AFINN" "1") ("relieving" "NA" "AFINN" "2") ("relishing" "NA" "AFINN" "2") ("remarkable" "NA" "AFINN" "2") ("remorse" "NA" "AFINN" "-2") ("repulse" "NA" "AFINN" "-1") ("repulsed" "NA" "AFINN" "-2") ("rescue" "NA" "AFINN" "2") ("rescued" "NA" "AFINN" "2") ("rescues" "NA" "AFINN" "2") ("resentful" "NA" "AFINN" "-2") ("resign" "NA" "AFINN" "-1") ("resigned" "NA" "AFINN" "-1") ("resigning" "NA" "AFINN" "-1") ("resigns" "NA" "AFINN" "-1") ("resolute" "NA" "AFINN" "2") ("resolve" "NA" "AFINN" "2") ("resolved" "NA" "AFINN" "2") ("resolves" "NA" "AFINN" "2") ("resolving" "NA" "AFINN" "2") ("respected" "NA" "AFINN" "2") ("responsible" "NA" "AFINN" "2") ("responsive" "NA" "AFINN" "2") ("restful" "NA" "AFINN" "2") ("restless" "NA" "AFINN" "-2") ("restore" "NA" "AFINN" "1") ("restored" "NA" "AFINN" "1") ("restores" "NA" "AFINN" "1") ("restoring" "NA" "AFINN" "1") ("restrict" "NA" "AFINN" "-2") ("restricted" "NA" "AFINN" "-2") ("restricting" "NA" "AFINN" "-2") ("restriction" "NA" "AFINN" "-2") ("restricts" "NA" "AFINN" "-2") ("retained" "NA" "AFINN" "-1") ("retard" "NA" "AFINN" "-2") ("retarded" "NA" "AFINN" "-2") ("retreat" "NA" "AFINN" "-1") ("revenge" "NA" "AFINN" "-2") ("revengeful" "NA" "AFINN" "-2") ("revered" "NA" "AFINN" "2") ("revive" "NA" "AFINN" "2") ("revives" "NA" "AFINN" "2") ("reward" "NA" "AFINN" "2") ("rewarded" "NA" "AFINN" "2") ("rewarding" "NA" "AFINN" "2") ("rewards" "NA" "AFINN" "2") ("rich" "NA" "AFINN" "2") ("ridiculous" "NA" "AFINN" "-3") ("rig" "NA" "AFINN" "-1") ("rigged" "NA" "AFINN" "-1") ("right direction" "NA" "AFINN" "3") ("rigorous" "NA" "AFINN" "3") ("rigorously" "NA" "AFINN" "3") ("riot" "NA" "AFINN" "-2") ("riots" "NA" "AFINN" "-2") ("risk" "NA" "AFINN" "-2") ("risks" "NA" "AFINN" "-2") ("rob" "NA" "AFINN" "-2") ("robber" "NA" "AFINN" "-2") ("robed" "NA" "AFINN" "-2") ("robing" "NA" "AFINN" "-2") ("robs" "NA" "AFINN" "-2") ("robust" "NA" "AFINN" "2") ("rofl" "NA" "AFINN" "4") ("roflcopter" "NA" "AFINN" "4") ("roflmao" "NA" "AFINN" "4") ("romance" "NA" "AFINN" "2") ("rotfl" "NA" "AFINN" "4") ("rotflmfao" "NA" "AFINN" "4") ("rotflol" "NA" "AFINN" "4") ("ruin" "NA" "AFINN" "-2") ("ruined" "NA" "AFINN" "-2") ("ruining" "NA" "AFINN" "-2") ("ruins" "NA" "AFINN" "-2") ("sabotage" "NA" "AFINN" "-2") ("sad" "NA" "AFINN" "-2") ("sadden" "NA" "AFINN" "-2") ("saddened" "NA" "AFINN" "-2") ("sadly" "NA" "AFINN" "-2") ("safe" "NA" "AFINN" "1") ("safely" "NA" "AFINN" "1") ("safety" "NA" "AFINN" "1") ("salient" "NA" "AFINN" "1") ("sappy" "NA" "AFINN" "-1") ("sarcastic" "NA" "AFINN" "-2") ("satisfied" "NA" "AFINN" "2") ("save" "NA" "AFINN" "2") ("saved" "NA" "AFINN" "2") ("scam" "NA" "AFINN" "-2") ("scams" "NA" "AFINN" "-2") ("scandal" "NA" "AFINN" "-3") ("scandalous" "NA" "AFINN" "-3") ("scandals" "NA" "AFINN" "-3") ("scapegoat" "NA" "AFINN" "-2") ("scapegoats" "NA" "AFINN" "-2") ("scare" "NA" "AFINN" "-2") ("scared" "NA" "AFINN" "-2") ("scary" "NA" "AFINN" "-2") ("sceptical" "NA" "AFINN" "-2") ("scold" "NA" "AFINN" "-2") ("scoop" "NA" "AFINN" "3") ("scorn" "NA" "AFINN" "-2") ("scornful" "NA" "AFINN" "-2") ("scream" "NA" "AFINN" "-2") ("screamed" "NA" "AFINN" "-2") ("screaming" "NA" "AFINN" "-2") ("screams" "NA" "AFINN" "-2") ("screwed" "NA" "AFINN" "-2") ("screwed up" "NA" "AFINN" "-3") ("scumbag" "NA" "AFINN" "-4") ("secure" "NA" "AFINN" "2") ("secured" "NA" "AFINN" "2") ("secures" "NA" "AFINN" "2") ("sedition" "NA" "AFINN" "-2") ("seditious" "NA" "AFINN" "-2") ("seduced" "NA" "AFINN" "-1") ("self-confident" "NA" "AFINN" "2") ("self-deluded" "NA" "AFINN" "-2") ("selfish" "NA" "AFINN" "-3") ("selfishness" "NA" "AFINN" "-3") ("sentence" "NA" "AFINN" "-2") ("sentenced" "NA" "AFINN" "-2") ("sentences" "NA" "AFINN" "-2") ("sentencing" "NA" "AFINN" "-2") ("serene" "NA" "AFINN" "2") ("severe" "NA" "AFINN" "-2") ("sexy" "NA" "AFINN" "3") ("shaky" "NA" "AFINN" "-2") ("shame" "NA" "AFINN" "-2") ("shamed" "NA" "AFINN" "-2") ("shameful" "NA" "AFINN" "-2") ("share" "NA" "AFINN" "1") ("shared" "NA" "AFINN" "1") ("shares" "NA" "AFINN" "1") ("shattered" "NA" "AFINN" "-2") ("shit" "NA" "AFINN" "-4") ("shithead" "NA" "AFINN" "-4") ("shitty" "NA" "AFINN" "-3") ("shock" "NA" "AFINN" "-2") ("shocked" "NA" "AFINN" "-2") ("shocking" "NA" "AFINN" "-2") ("shocks" "NA" "AFINN" "-2") ("shoot" "NA" "AFINN" "-1") ("short-sighted" "NA" "AFINN" "-2") ("short-sightedness" "NA" "AFINN" "-2") ("shortage" "NA" "AFINN" "-2") ("shortages" "NA" "AFINN" "-2") ("shrew" "NA" "AFINN" "-4") ("shy" "NA" "AFINN" "-1") ("sick" "NA" "AFINN" "-2") ("sigh" "NA" "AFINN" "-2") ("significance" "NA" "AFINN" "1") ("significant" "NA" "AFINN" "1") ("silencing" "NA" "AFINN" "-1") ("silly" "NA" "AFINN" "-1") ("sincere" "NA" "AFINN" "2") ("sincerely" "NA" "AFINN" "2") ("sincerest" "NA" "AFINN" "2") ("sincerity" "NA" "AFINN" "2") ("sinful" "NA" "AFINN" "-3") ("singleminded" "NA" "AFINN" "-2") ("skeptic" "NA" "AFINN" "-2") ("skeptical" "NA" "AFINN" "-2") ("skepticism" "NA" "AFINN" "-2") ("skeptics" "NA" "AFINN" "-2") ("slam" "NA" "AFINN" "-2") ("slash" "NA" "AFINN" "-2") ("slashed" "NA" "AFINN" "-2") ("slashes" "NA" "AFINN" "-2") ("slashing" "NA" "AFINN" "-2") ("slavery" "NA" "AFINN" "-3") ("sleeplessness" "NA" "AFINN" "-2") ("slick" "NA" "AFINN" "2") ("slicker" "NA" "AFINN" "2") ("slickest" "NA" "AFINN" "2") ("sluggish" "NA" "AFINN" "-2") ("slut" "NA" "AFINN" "-5") ("smart" "NA" "AFINN" "1") ("smarter" "NA" "AFINN" "2") ("smartest" "NA" "AFINN" "2") ("smear" "NA" "AFINN" "-2") ("smile" "NA" "AFINN" "2") ("smiled" "NA" "AFINN" "2") ("smiles" "NA" "AFINN" "2") ("smiling" "NA" "AFINN" "2") ("smog" "NA" "AFINN" "-2") ("sneaky" "NA" "AFINN" "-1") ("snub" "NA" "AFINN" "-2") ("snubbed" "NA" "AFINN" "-2") ("snubbing" "NA" "AFINN" "-2") ("snubs" "NA" "AFINN" "-2") ("sobering" "NA" "AFINN" "1") ("solemn" "NA" "AFINN" "-1") ("solid" "NA" "AFINN" "2") ("solidarity" "NA" "AFINN" "2") ("solution" "NA" "AFINN" "1") ("solutions" "NA" "AFINN" "1") ("solve" "NA" "AFINN" "1") ("solved" "NA" "AFINN" "1") ("solves" "NA" "AFINN" "1") ("solving" "NA" "AFINN" "1") ("somber" "NA" "AFINN" "-2") ("some kind" "NA" "AFINN" "0") ("son-of-a-bitch" "NA" "AFINN" "-5") ("soothe" "NA" "AFINN" "3") ("soothed" "NA" "AFINN" "3") ("soothing" "NA" "AFINN" "3") ("sophisticated" "NA" "AFINN" "2") ("sore" "NA" "AFINN" "-1") ("sorrow" "NA" "AFINN" "-2") ("sorrowful" "NA" "AFINN" "-2") ("sorry" "NA" "AFINN" "-1") ("spam" "NA" "AFINN" "-2") ("spammer" "NA" "AFINN" "-3") ("spammers" "NA" "AFINN" "-3") ("spamming" "NA" "AFINN" "-2") ("spark" "NA" "AFINN" "1") ("sparkle" "NA" "AFINN" "3") ("sparkles" "NA" "AFINN" "3") ("sparkling" "NA" "AFINN" "3") ("speculative" "NA" "AFINN" "-2") ("spirit" "NA" "AFINN" "1") ("spirited" "NA" "AFINN" "2") ("spiritless" "NA" "AFINN" "-2") ("spiteful" "NA" "AFINN" "-2") ("splendid" "NA" "AFINN" "3") ("sprightly" "NA" "AFINN" "2") ("squelched" "NA" "AFINN" "-1") ("stab" "NA" "AFINN" "-2") ("stabbed" "NA" "AFINN" "-2") ("stable" "NA" "AFINN" "2") ("stabs" "NA" "AFINN" "-2") ("stall" "NA" "AFINN" "-2") ("stalled" "NA" "AFINN" "-2") ("stalling" "NA" "AFINN" "-2") ("stamina" "NA" "AFINN" "2") ("stampede" "NA" "AFINN" "-2") ("startled" "NA" "AFINN" "-2") ("starve" "NA" "AFINN" "-2") ("starved" "NA" "AFINN" "-2") ("starves" "NA" "AFINN" "-2") ("starving" "NA" "AFINN" "-2") ("steadfast" "NA" "AFINN" "2") ("steal" "NA" "AFINN" "-2") ("steals" "NA" "AFINN" "-2") ("stereotype" "NA" "AFINN" "-2") ("stereotyped" "NA" "AFINN" "-2") ("stifled" "NA" "AFINN" "-1") ("stimulate" "NA" "AFINN" "1") ("stimulated" "NA" "AFINN" "1") ("stimulates" "NA" "AFINN" "1") ("stimulating" "NA" "AFINN" "2") ("stingy" "NA" "AFINN" "-2") ("stolen" "NA" "AFINN" "-2") ("stop" "NA" "AFINN" "-1") ("stopped" "NA" "AFINN" "-1") ("stopping" "NA" "AFINN" "-1") ("stops" "NA" "AFINN" "-1") ("stout" "NA" "AFINN" "2") ("straight" "NA" "AFINN" "1") ("strange" "NA" "AFINN" "-1") ("strangely" "NA" "AFINN" "-1") ("strangled" "NA" "AFINN" "-2") ("strength" "NA" "AFINN" "2") ("strengthen" "NA" "AFINN" "2") ("strengthened" "NA" "AFINN" "2") ("strengthening" "NA" "AFINN" "2") ("strengthens" "NA" "AFINN" "2") ("stressed" "NA" "AFINN" "-2") ("stressor" "NA" "AFINN" "-2") ("stressors" "NA" "AFINN" "-2") ("stricken" "NA" "AFINN" "-2") ("strike" "NA" "AFINN" "-1") ("strikers" "NA" "AFINN" "-2") ("strikes" "NA" "AFINN" "-1") ("strong" "NA" "AFINN" "2") ("stronger" "NA" "AFINN" "2") ("strongest" "NA" "AFINN" "2") ("struck" "NA" "AFINN" "-1") ("struggle" "NA" "AFINN" "-2") ("struggled" "NA" "AFINN" "-2") ("struggles" "NA" "AFINN" "-2") ("struggling" "NA" "AFINN" "-2") ("stubborn" "NA" "AFINN" "-2") ("stuck" "NA" "AFINN" "-2") ("stunned" "NA" "AFINN" "-2") ("stunning" "NA" "AFINN" "4") ("stupid" "NA" "AFINN" "-2") ("stupidly" "NA" "AFINN" "-2") ("suave" "NA" "AFINN" "2") ("substantial" "NA" "AFINN" "1") ("substantially" "NA" "AFINN" "1") ("subversive" "NA" "AFINN" "-2") ("success" "NA" "AFINN" "2") ("successful" "NA" "AFINN" "3") ("suck" "NA" "AFINN" "-3") ("sucks" "NA" "AFINN" "-3") ("suffer" "NA" "AFINN" "-2") ("suffering" "NA" "AFINN" "-2") ("suffers" "NA" "AFINN" "-2") ("suicidal" "NA" "AFINN" "-2") ("suicide" "NA" "AFINN" "-2") ("suing" "NA" "AFINN" "-2") ("sulking" "NA" "AFINN" "-2") ("sulky" "NA" "AFINN" "-2") ("sullen" "NA" "AFINN" "-2") ("sunshine" "NA" "AFINN" "2") ("super" "NA" "AFINN" "3") ("superb" "NA" "AFINN" "5") ("superior" "NA" "AFINN" "2") ("support" "NA" "AFINN" "2") ("supported" "NA" "AFINN" "2") ("supporter" "NA" "AFINN" "1") ("supporters" "NA" "AFINN" "1") ("supporting" "NA" "AFINN" "1") ("supportive" "NA" "AFINN" "2") ("supports" "NA" "AFINN" "2") ("survived" "NA" "AFINN" "2") ("surviving" "NA" "AFINN" "2") ("survivor" "NA" "AFINN" "2") ("suspect" "NA" "AFINN" "-1") ("suspected" "NA" "AFINN" "-1") ("suspecting" "NA" "AFINN" "-1") ("suspects" "NA" "AFINN" "-1") ("suspend" "NA" "AFINN" "-1") ("suspended" "NA" "AFINN" "-1") ("suspicious" "NA" "AFINN" "-2") ("swear" "NA" "AFINN" "-2") ("swearing" "NA" "AFINN" "-2") ("swears" "NA" "AFINN" "-2") ("sweet" "NA" "AFINN" "2") ("swift" "NA" "AFINN" "2") ("swiftly" "NA" "AFINN" "2") ("swindle" "NA" "AFINN" "-3") ("swindles" "NA" "AFINN" "-3") ("swindling" "NA" "AFINN" "-3") ("sympathetic" "NA" "AFINN" "2") ("sympathy" "NA" "AFINN" "2") ("tard" "NA" "AFINN" "-2") ("tears" "NA" "AFINN" "-2") ("tender" "NA" "AFINN" "2") ("tense" "NA" "AFINN" "-2") ("tension" "NA" "AFINN" "-1") ("terrible" "NA" "AFINN" "-3") ("terribly" "NA" "AFINN" "-3") ("terrific" "NA" "AFINN" "4") ("terrified" "NA" "AFINN" "-3") ("terror" "NA" "AFINN" "-3") ("terrorize" "NA" "AFINN" "-3") ("terrorized" "NA" "AFINN" "-3") ("terrorizes" "NA" "AFINN" "-3") ("thank" "NA" "AFINN" "2") ("thankful" "NA" "AFINN" "2") ("thanks" "NA" "AFINN" "2") ("thorny" "NA" "AFINN" "-2") ("thoughtful" "NA" "AFINN" "2") ("thoughtless" "NA" "AFINN" "-2") ("threat" "NA" "AFINN" "-2") ("threaten" "NA" "AFINN" "-2") ("threatened" "NA" "AFINN" "-2") ("threatening" "NA" "AFINN" "-2") ("threatens" "NA" "AFINN" "-2") ("threats" "NA" "AFINN" "-2") ("thrilled" "NA" "AFINN" "5") ("thwart" "NA" "AFINN" "-2") ("thwarted" "NA" "AFINN" "-2") ("thwarting" "NA" "AFINN" "-2") ("thwarts" "NA" "AFINN" "-2") ("timid" "NA" "AFINN" "-2") ("timorous" "NA" "AFINN" "-2") ("tired" "NA" "AFINN" "-2") ("tits" "NA" "AFINN" "-2") ("tolerant" "NA" "AFINN" "2") ("toothless" "NA" "AFINN" "-2") ("top" "NA" "AFINN" "2") ("tops" "NA" "AFINN" "2") ("torn" "NA" "AFINN" "-2") ("torture" "NA" "AFINN" "-4") ("tortured" "NA" "AFINN" "-4") ("tortures" "NA" "AFINN" "-4") ("torturing" "NA" "AFINN" "-4") ("totalitarian" "NA" "AFINN" "-2") ("totalitarianism" "NA" "AFINN" "-2") ("tout" "NA" "AFINN" "-2") ("touted" "NA" "AFINN" "-2") ("touting" "NA" "AFINN" "-2") ("touts" "NA" "AFINN" "-2") ("tragedy" "NA" "AFINN" "-2") ("tragic" "NA" "AFINN" "-2") ("tranquil" "NA" "AFINN" "2") ("trap" "NA" "AFINN" "-1") ("trapped" "NA" "AFINN" "-2") ("trauma" "NA" "AFINN" "-3") ("traumatic" "NA" "AFINN" "-3") ("travesty" "NA" "AFINN" "-2") ("treason" "NA" "AFINN" "-3") ("treasonous" "NA" "AFINN" "-3") ("treasure" "NA" "AFINN" "2") ("treasures" "NA" "AFINN" "2") ("trembling" "NA" "AFINN" "-2") ("tremulous" "NA" "AFINN" "-2") ("tricked" "NA" "AFINN" "-2") ("trickery" "NA" "AFINN" "-2") ("triumph" "NA" "AFINN" "4") ("triumphant" "NA" "AFINN" "4") ("trouble" "NA" "AFINN" "-2") ("troubled" "NA" "AFINN" "-2") ("troubles" "NA" "AFINN" "-2") ("true" "NA" "AFINN" "2") ("trust" "NA" "AFINN" "1") ("trusted" "NA" "AFINN" "2") ("tumor" "NA" "AFINN" "-2") ("twat" "NA" "AFINN" "-5") ("ugly" "NA" "AFINN" "-3") ("unacceptable" "NA" "AFINN" "-2") ("unappreciated" "NA" "AFINN" "-2") ("unapproved" "NA" "AFINN" "-2") ("unaware" "NA" "AFINN" "-2") ("unbelievable" "NA" "AFINN" "-1") ("unbelieving" "NA" "AFINN" "-1") ("unbiased" "NA" "AFINN" "2") ("uncertain" "NA" "AFINN" "-1") ("unclear" "NA" "AFINN" "-1") ("uncomfortable" "NA" "AFINN" "-2") ("unconcerned" "NA" "AFINN" "-2") ("unconfirmed" "NA" "AFINN" "-1") ("unconvinced" "NA" "AFINN" "-1") ("uncredited" "NA" "AFINN" "-1") ("undecided" "NA" "AFINN" "-1") ("underestimate" "NA" "AFINN" "-1") ("underestimated" "NA" "AFINN" "-1") ("underestimates" "NA" "AFINN" "-1") ("underestimating" "NA" "AFINN" "-1") ("undermine" "NA" "AFINN" "-2") ("undermined" "NA" "AFINN" "-2") ("undermines" "NA" "AFINN" "-2") ("undermining" "NA" "AFINN" "-2") ("undeserving" "NA" "AFINN" "-2") ("undesirable" "NA" "AFINN" "-2") ("uneasy" "NA" "AFINN" "-2") ("unemployment" "NA" "AFINN" "-2") ("unequal" "NA" "AFINN" "-1") ("unequaled" "NA" "AFINN" "2") ("unethical" "NA" "AFINN" "-2") ("unfair" "NA" "AFINN" "-2") ("unfocused" "NA" "AFINN" "-2") ("unfulfilled" "NA" "AFINN" "-2") ("unhappy" "NA" "AFINN" "-2") ("unhealthy" "NA" "AFINN" "-2") ("unified" "NA" "AFINN" "1") ("unimpressed" "NA" "AFINN" "-2") ("unintelligent" "NA" "AFINN" "-2") ("united" "NA" "AFINN" "1") ("unjust" "NA" "AFINN" "-2") ("unlovable" "NA" "AFINN" "-2") ("unloved" "NA" "AFINN" "-2") ("unmatched" "NA" "AFINN" "1") ("unmotivated" "NA" "AFINN" "-2") ("unprofessional" "NA" "AFINN" "-2") ("unresearched" "NA" "AFINN" "-2") ("unsatisfied" "NA" "AFINN" "-2") ("unsecured" "NA" "AFINN" "-2") ("unsettled" "NA" "AFINN" "-1") ("unsophisticated" "NA" "AFINN" "-2") ("unstable" "NA" "AFINN" "-2") ("unstoppable" "NA" "AFINN" "2") ("unsupported" "NA" "AFINN" "-2") ("unsure" "NA" "AFINN" "-1") ("untarnished" "NA" "AFINN" "2") ("unwanted" "NA" "AFINN" "-2") ("unworthy" "NA" "AFINN" "-2") ("upset" "NA" "AFINN" "-2") ("upsets" "NA" "AFINN" "-2") ("upsetting" "NA" "AFINN" "-2") ("uptight" "NA" "AFINN" "-2") ("urgent" "NA" "AFINN" "-1") ("useful" "NA" "AFINN" "2") ("usefulness" "NA" "AFINN" "2") ("useless" "NA" "AFINN" "-2") ("uselessness" "NA" "AFINN" "-2") ("vague" "NA" "AFINN" "-2") ("validate" "NA" "AFINN" "1") ("validated" "NA" "AFINN" "1") ("validates" "NA" "AFINN" "1") ("validating" "NA" "AFINN" "1") ("verdict" "NA" "AFINN" "-1") ("verdicts" "NA" "AFINN" "-1") ("vested" "NA" "AFINN" "1") ("vexation" "NA" "AFINN" "-2") ("vexing" "NA" "AFINN" "-2") ("vibrant" "NA" "AFINN" "3") ("vicious" "NA" "AFINN" "-2") ("victim" "NA" "AFINN" "-3") ("victimize" "NA" "AFINN" "-3") ("victimized" "NA" "AFINN" "-3") ("victimizes" "NA" "AFINN" "-3") ("victimizing" "NA" "AFINN" "-3") ("victims" "NA" "AFINN" "-3") ("vigilant" "NA" "AFINN" "3") ("vile" "NA" "AFINN" "-3") ("vindicate" "NA" "AFINN" "2") ("vindicated" "NA" "AFINN" "2") ("vindicates" "NA" "AFINN" "2") ("vindicating" "NA" "AFINN" "2") ("violate" "NA" "AFINN" "-2") ("violated" "NA" "AFINN" "-2") ("violates" "NA" "AFINN" "-2") ("violating" "NA" "AFINN" "-2") ("violence" "NA" "AFINN" "-3") ("violent" "NA" "AFINN" "-3") ("virtuous" "NA" "AFINN" "2") ("virulent" "NA" "AFINN" "-2") ("vision" "NA" "AFINN" "1") ("visionary" "NA" "AFINN" "3") ("visioning" "NA" "AFINN" "1") ("visions" "NA" "AFINN" "1") ("vitality" "NA" "AFINN" "3") ("vitamin" "NA" "AFINN" "1") ("vitriolic" "NA" "AFINN" "-3") ("vivacious" "NA" "AFINN" "3") ("vociferous" "NA" "AFINN" "-1") ("vulnerability" "NA" "AFINN" "-2") ("vulnerable" "NA" "AFINN" "-2") ("walkout" "NA" "AFINN" "-2") ("walkouts" "NA" "AFINN" "-2") ("wanker" "NA" "AFINN" "-3") ("want" "NA" "AFINN" "1") ("war" "NA" "AFINN" "-2") ("warfare" "NA" "AFINN" "-2") ("warm" "NA" "AFINN" "1") ("warmth" "NA" "AFINN" "2") ("warn" "NA" "AFINN" "-2") ("warned" "NA" "AFINN" "-2") ("warning" "NA" "AFINN" "-3") ("warnings" "NA" "AFINN" "-3") ("warns" "NA" "AFINN" "-2") ("waste" "NA" "AFINN" "-1") ("wasted" "NA" "AFINN" "-2") ("wasting" "NA" "AFINN" "-2") ("wavering" "NA" "AFINN" "-1") ("weak" "NA" "AFINN" "-2") ("weakness" "NA" "AFINN" "-2") ("wealth" "NA" "AFINN" "3") ("wealthy" "NA" "AFINN" "2") ("weary" "NA" "AFINN" "-2") ("weep" "NA" "AFINN" "-2") ("weeping" "NA" "AFINN" "-2") ("weird" "NA" "AFINN" "-2") ("welcome" "NA" "AFINN" "2") ("welcomed" "NA" "AFINN" "2") ("welcomes" "NA" "AFINN" "2") ("whimsical" "NA" "AFINN" "1") ("whitewash" "NA" "AFINN" "-3") ("whore" "NA" "AFINN" "-4") ("wicked" "NA" "AFINN" "-2") ("widowed" "NA" "AFINN" "-1") ("willingness" "NA" "AFINN" "2") ("win" "NA" "AFINN" "4") ("winner" "NA" "AFINN" "4") ("winning" "NA" "AFINN" "4") ("wins" "NA" "AFINN" "4") ("winwin" "NA" "AFINN" "3") ("wish" "NA" "AFINN" "1") ("wishes" "NA" "AFINN" "1") ("wishing" "NA" "AFINN" "1") ("withdrawal" "NA" "AFINN" "-3") ("woebegone" "NA" "AFINN" "-2") ("woeful" "NA" "AFINN" "-3") ("won" "NA" "AFINN" "3") ("wonderful" "NA" "AFINN" "4") ("woo" "NA" "AFINN" "3") ("woohoo" "NA" "AFINN" "3") ("wooo" "NA" "AFINN" "4") ("woow" "NA" "AFINN" "4") ("worn" "NA" "AFINN" "-1") ("worried" "NA" "AFINN" "-3") ("worry" "NA" "AFINN" "-3") ("worrying" "NA" "AFINN" "-3") ("worse" "NA" "AFINN" "-3") ("worsen" "NA" "AFINN" "-3") ("worsened" "NA" "AFINN" "-3") ("worsening" "NA" "AFINN" "-3") ("worsens" "NA" "AFINN" "-3") ("worshiped" "NA" "AFINN" "3") ("worst" "NA" "AFINN" "-3") ("worth" "NA" "AFINN" "2") ("worthless" "NA" "AFINN" "-2") ("worthy" "NA" "AFINN" "2") ("wow" "NA" "AFINN" "4") ("wowow" "NA" "AFINN" "4") ("wowww" "NA" "AFINN" "4") ("wrathful" "NA" "AFINN" "-3") ("wreck" "NA" "AFINN" "-2") ("wrong" "NA" "AFINN" "-2") ("wronged" "NA" "AFINN" "-2") ("wtf" "NA" "AFINN" "-4") ("yeah" "NA" "AFINN" "1") ("yearning" "NA" "AFINN" "1") ("yeees" "NA" "AFINN" "2") ("yes" "NA" "AFINN" "1") ("youthful" "NA" "AFINN" "2") ("yucky" "NA" "AFINN" "-2") ("yummy" "NA" "AFINN" "3") ("zealot" "NA" "AFINN" "-2") ("zealots" "NA" "AFINN" "-2") ("zealous" "NA" "AFINN" "2"))) -------------------------------------------------------------------------------- /lexicons/SMART-stopwords: -------------------------------------------------------------------------------- 1 | #lang racket/base 2 | (provide SMART) 3 | 4 | (define SMART '("a" "a's" "able" "about" "above" "according" "accordingly" "across" "actually" "after" "afterwards" "again" "against" "ain't" "all" "allow" "allows" "almost" "alone" "along" "already" "also" "although" "always" "am" "among" "amongst" "an" "and" "another" "any" "anybody" "anyhow" "anyone" "anything" "anyway" "anyways" "anywhere" "apart" "appear" "appreciate" "appropriate" "are" "aren't" "around" "as" "aside" "ask" "asking" "associated" "at" "available" "away" "awfully" "b" "be" "became" "because" "become" "becomes" "becoming" "been" "before" "beforehand" "behind" "being" "believe" "below" "beside" "besides" "best" "better" "between" "beyond" "both" "brief" "but" "by" "c" "c'mon" "c's" "came" "can" "can't" "cannot" "cant" "cause" "causes" "certain" "certainly" "changes" "clearly" "co" "com" "come" "comes" "concerning" "consequently" "consider" "considering" "contain" "containing" "contains" "corresponding" "could" "couldn't" "course" "currently" "d" "definitely" "described" "despite" "did" "didn't" "different" "do" "does" "doesn't" "doing" "don't" "done" "down" "downwards" "during" "e" "each" "edu" "eg" "eight" "either" "else" "elsewhere" "enough" "entirely" "especially" "et" "etc" "even" "ever" "every" "everybody" "everyone" "everything" "everywhere" "ex" "exactly" "example" "except" "f" "far" "few" "fifth" "first" "five" "followed" "following" "follows" "for" "former" "formerly" "forth" "four" "from" "further" "furthermore" "g" "get" "gets" "getting" "given" "gives" "go" "goes" "going" "gone" "got" "gotten" "greetings" "h" "had" "hadn't" "happens" "hardly" "has" "hasn't" "have" "haven't" "having" "he" "he's" "hello" "help" "hence" "her" "here" "here's" "hereafter" "hereby" "herein" "hereupon" "hers" "herself" "hi" "him" "himself" "his" "hither" "hopefully" "how" "howbeit" "however" "i" "i'd" "i'll" "i'm" "i've" "ie" "if" "ignored" "immediate" "in" "inasmuch" "inc" "indeed" "indicate" "indicated" "indicates" "inner" "insofar" "instead" "into" "inward" "is" "isn't" "it" "it'd" "it'll" "it's" "its" "itself" "j" "just" "k" "keep" "keeps" "kept" "know" "knows" "known" "l" "last" "lately" "later" "latter" "latterly" "least" "less" "lest" "let" "let's" "like" "liked" "likely" "little" "look" "looking" "looks" "ltd" "m" "mainly" "many" "may" "maybe" "me" "mean" "meanwhile" "merely" "might" "more" "moreover" "most" "mostly" "much" "must" "my" "myself" "n" "name" "namely" "nd" "near" "nearly" "necessary" "need" "needs" "neither" "never" "nevertheless" "new" "next" "nine" "no" "nobody" "non" "none" "noone" "nor" "normally" "not" "nothing" "novel" "now" "nowhere" "o" "obviously" "of" "off" "often" "oh" "ok" "okay" "old" "on" "once" "one" "ones" "only" "onto" "or" "other" "others" "otherwise" "ought" "our" "ours" "ourselves" "out" "outside" "over" "overall" "own" "p" "particular" "particularly" "per" "perhaps" "placed" "please" "plus" "possible" "presumably" "probably" "provides" "q" "que" "quite" "qv" "r" "rather" "rd" "re" "really" "reasonably" "regarding" "regardless" "regards" "relatively" "respectively" "right" "s" "said" "same" "saw" "say" "saying" "says" "second" "secondly" "see" "seeing" "seem" "seemed" "seeming" "seems" "seen" "self" "selves" "sensible" "sent" "serious" "seriously" "seven" "several" "shall" "she" "should" "shouldn't" "since" "six" "so" "some" "somebody" "somehow" "someone" "something" "sometime" "sometimes" "somewhat" "somewhere" "soon" "sorry" "specified" "specify" "specifying" "still" "sub" "such" "sup" "sure" "t" "t's" "take" "taken" "tell" "tends" "th" "than" "thank" "thanks" "thanx" "that" "that's" "thats" "the" "their" "theirs" "them" "themselves" "then" "thence" "there" "there's" "thereafter" "thereby" "therefore" "therein" "theres" "thereupon" "these" "they" "they'd" "they'll" "they're" "they've" "think" "third" "this" "thorough" "thoroughly" "those" "though" "three" "through" "throughout" "thru" "thus" "to" "together" "too" "took" "toward" "towards" "tried" "tries" "truly" "try" "trying" "twice" "two" "u" "un" "under" "unfortunately" "unless" "unlikely" "until" "unto" "up" "upon" "us" "use" "used" "useful" "uses" "using" "usually" "uucp" "v" "value" "various" "very" "via" "viz" "vs" "w" "want" "wants" "was" "wasn't" "way" "we" "we'd" "we'll" "we're" "we've" "welcome" "well" "went" "were" "weren't" "what" "what's" "whatever" "when" "whence" "whenever" "where" "where's" "whereafter" "whereas" "whereby" "wherein" "whereupon" "wherever" "whether" "which" "while" "whither" "who" "who's" "whoever" "whole" "whom" "whose" "why" "will" "willing" "wish" "with" "within" "without" "won't" "wonder" "would" "would" "wouldn't" "x" "y" "yes" "yet" "you" "you'd" "you'll" "you're" "you've" "your" "yours" "yourself" "yourselves" "z" "zero")) -------------------------------------------------------------------------------- /lexicons/onix-stopwords: -------------------------------------------------------------------------------- 1 | #lang racket/base 2 | (provide onix) 3 | 4 | (define onix '("a" "about" "above" "across" "after" "again" "against" "all" "almost" "alone" "along" "already" "also" "although" "always" "among" "an" "and" "another" "any" "anybody" "anyone" "anything" "anywhere" "are" "area" "areas" "around" "as" "ask" "asked" "asking" "asks" "at" "away" "back" "backed" "backing" "backs" "be" "became" "because" "become" "becomes" "been" "before" "began" "behind" "being" "beings" "best" "better" "between" "big" "both" "but" "by" "came" "can" "cannot" "case" "cases" "certain" "certainly" "clear" "clearly" "come" "could" "did" "differ" "different" "differently" "do" "does" "done" "down" "down" "downed" "downing" "downs" "during" "each" "early" "either" "end" "ended" "ending" "ends" "enough" "even" "evenly" "ever" "every" "everybody" "everyone" "everything" "everywhere" "face" "faces" "fact" "facts" "far" "felt" "few" "find" "finds" "first" "for" "four" "from" "full" "fully" "further" "furthered" "furthering" "furthers" "gave" "general" "generally" "get" "gets" "give" "given" "gives" "go" "going" "good" "goods" "got" "great" "greater" "greatest" "group" "grouped" "grouping" "groups" "had" "has" "have" "having" "he" "her" "here" "herself" "high" "high" "high" "higher" "highest" "him" "himself" "his" "how" "however" "i" "if" "important" "in" "interest" "interested" "interesting" "interests" "into" "is" "it" "its" "itself" "just" "keep" "keeps" "kind" "knew" "know" "known" "knows" "large" "largely" "last" "later" "latest" "least" "less" "let" "lets" "like" "likely" "long" "longer" "longest" "made" "make" "making" "man" "many" "may" "me" "member" "members" "men" "might" "more" "most" "mostly" "mr" "mrs" "much" "must" "my" "myself" "necessary" "need" "needed" "needing" "needs" "never" "new" "new" "newer" "newest" "next" "no" "nobody" "non" "noone" "not" "nothing" "now" "nowhere" "number" "numbers" "of" "off" "often" "old" "older" "oldest" "on" "once" "one" "only" "open" "opened" "opening" "opens" "or" "order" "ordered" "ordering" "orders" "other" "others" "our" "out" "over" "part" "parted" "parting" "parts" "per" "perhaps" "place" "places" "point" "pointed" "pointing" "points" "possible" "present" "presented" "presenting" "presents" "problem" "problems" "put" "puts" "quite" "rather" "really" "right" "right" "room" "rooms" "said" "same" "saw" "say" "says" "second" "seconds" "see" "seem" "seemed" "seeming" "seems" "sees" "several" "shall" "she" "should" "show" "showed" "showing" "shows" "side" "sides" "since" "small" "smaller" "smallest" "some" "somebody" "someone" "something" "somewhere" "state" "states" "still" "still" "such" "sure" "take" "taken" "than" "that" "the" "their" "them" "then" "there" "therefore" "these" "they" "thing" "things" "think" "thinks" "this" "those" "though" "thought" "thoughts" "three" "through" "thus" "to" "today" "together" "too" "took" "toward" "turn" "turned" "turning" "turns" "two" "under" "until" "up" "upon" "us" "use" "used" "uses" "very" "want" "wanted" "wanting" "wants" "was" "way" "ways" "we" "well" "wells" "went" "were" "what" "when" "where" "whether" "which" "while" "who" "whole" "whose" "why" "will" "with" "within" "without" "work" "worked" "working" "works" "would" "year" "years" "yet" "you" "young" "younger" "youngest" "your" "yours")) -------------------------------------------------------------------------------- /lexicons/snowball-stopwords: -------------------------------------------------------------------------------- 1 | #lang racket/base 2 | (provide snowball) 3 | 4 | (define snowball '("i" "me" "my" "myself" "we" "our" "ours" "ourselves" "you" "your" "yours" "yourself" "yourselves" "he" "him" "his" "himself" "she" "her" "hers" "herself" "it" "its" "itself" "they" "them" "their" "theirs" "themselves" "what" "which" "who" "whom" "this" "that" "these" "those" "am" "is" "are" "was" "were" "be" "been" "being" "have" "has" "had" "having" "do" "does" "did" "doing" "would" "should" "could" "ought" "i'm" "you're" "he's" "she's" "it's" "we're" "they're" "i've" "you've" "we've" "they've" "i'd" "you'd" "he'd" "she'd" "we'd" "they'd" "i'll" "you'll" "he'll" "she'll" "we'll" "they'll" "isn't" "aren't" "wasn't" "weren't" "hasn't" "haven't" "hadn't" "doesn't" "don't" "didn't" "won't" "wouldn't" "shan't" "shouldn't" "can't" "cannot" "couldn't" "mustn't" "let's" "that's" "who's" "what's" "here's" "there's" "when's" "where's" "why's" "how's" "a" "an" "the" "and" "but" "if" "or" "because" "as" "until" "while" "of" "at" "by" "for" "with" "about" "against" "between" "into" "through" "during" "before" "after" "above" "below" "to" "from" "up" "down" "in" "out" "on" "off" "over" "under" "again" "further" "then" "once" "here" "there" "when" "where" "why" "how" "all" "any" "both" "each" "few" "more" "most" "other" "some" "such" "no" "nor" "not" "only" "own" "same" "so" "than" "too" "very")) -------------------------------------------------------------------------------- /main.rkt: -------------------------------------------------------------------------------- 1 | #lang racket 2 | 3 | ;;; This file provides convenience functions for working with data in 4 | ;;; Racket, including easier csv import (with heuristic-driven 5 | ;;; automatic ->number conversion when appropriate), and plotting 6 | ;;; functions. 7 | 8 | ;;; Dependencies 9 | (require "./lexicons/nrc-lexicon") 10 | (require "./lexicons/bing-lexicon") 11 | (require "./lexicons/AFINN-lexicon") 12 | (require "./lexicons/SMART-stopwords") 13 | (require "./lexicons/snowball-stopwords") 14 | (require "./lexicons/onix-stopwords") 15 | 16 | (require csv-reading math math/matrix plot racket/hash) 17 | 18 | (provide aref read-csv write-csv ci subset $ group-with aggregate sorted-counts 19 | hist hist* scale log-base xs linear-model linear-model* chi-square-goodness 20 | svd-1d cov document->tokens tdm dtm cosine-similarity 21 | token->sentiment list->sentiment remove-urls 22 | remove-punctuation remove-stopwords n-gram qq-plot qq-plot* 23 | (all-from-out "./lexicons/nrc-lexicon" 24 | "./lexicons/bing-lexicon" 25 | "./lexicons/AFINN-lexicon" 26 | "./lexicons/SMART-stopwords" 27 | "./lexicons/snowball-stopwords" 28 | "./lexicons/onix-stopwords")) 29 | 30 | ;;; Can't live without alist-ref from Chicken scheme. Let's recreate 31 | ;;; it here, but with a shorter name 32 | (define (aref idx lst) 33 | (let ([tmp (assv idx lst)]) 34 | (if tmp 35 | (cadr tmp) 36 | #f))) 37 | 38 | ;;; Convenience csv reader that can convert everything internally to 39 | ;;; numbers. It also igores lines in the input file commented with the 40 | ;;; "#" character. When header? is not #f, the first line of the file 41 | ;;; is assumed to contain column names. 42 | (define (read-csv file-path 43 | #:->number? [->number? #f] 44 | #:header? [header? #t]) 45 | (let ((csv-reader (make-csv-reader-maker 46 | '((comment-chars #\#))))) 47 | (with-input-from-file file-path 48 | (lambda () 49 | (let* ((tmp (csv->list (csv-reader (current-input-port))))) 50 | (if ->number? 51 | ;; try to convert everything to numbers rather than 52 | ;; strings. This should be made smarter, converting only 53 | ;; those columns which are actually numbers 54 | (if header? 55 | (cons (car tmp) (map (lambda (x) (map string->number x)) (cdr tmp))) 56 | (map (lambda (x) (map string->number x)) tmp)) 57 | ;; Else, leave everything as strings 58 | tmp)))))) 59 | 60 | ;;; Embedded quotes (" or ') in csv files should be doubled. i.e., 61 | ;;; " -> "" and ' -> '' 62 | (define (string-cleaner strng) 63 | (string-append "\"" (regexp-replace* "\"" strng "\"\"") "\"")) 64 | 65 | ;;; Missing, true/false, etc data can be adjusted here. Without this 66 | ;;; step, true/false data would be written to file as #t/#f and 67 | ;;; missing data as null. We could change those behaviors to 68 | ;;; TRUE/FALSE and NA here. 69 | (define (format-csv-record record) 70 | (cond 71 | ;; [(eq? record #t) #t] 72 | ;; [(eq? record #f) #f] 73 | ;; [(eq? record 'null) null] 74 | [(string? record) (string-cleaner record)] 75 | [else record])) 76 | 77 | ;;; This writes a list of lists (record) to disk. 78 | (define (write-csv records file-path #:delimeter [delimeter #\,]) 79 | (with-output-to-file file-path 80 | (λ () 81 | ;; Outer loop across rows 82 | (for-each (lambda (row) 83 | ;; Inner loop across columns 84 | (let column-loop ((fields row)) 85 | (if (null? fields) 86 | (newline) 87 | (let ((curr-field (format-csv-record (car fields))) 88 | (final? (null? (cdr fields)))) 89 | ;; (write curr-field) 90 | (display curr-field) 91 | (when (not final?) (display delimeter)) 92 | (column-loop (cdr fields)))))) 93 | records)))) 94 | 95 | ;;; Extract a particular column of data from a list of lists by 96 | ;;; (c)olumn (i)index number 97 | (define (ci idx lsts) 98 | (map (lambda (x) (list-ref x idx)) lsts)) 99 | 100 | ;;; We need to be able to logically index one column against 101 | ;;; another. Assuming a list of lists "d" containing our data, we can 102 | ;;; grab only those rows where the 5th column == 1118. The resulting 103 | ;;; indexed list of lists can then be fed into other procedures such 104 | ;;; as "ci" 105 | ;;; Example: (filter (lambda (x) (= 1118 (list-ref x 5))) d) 106 | 107 | ;;; This provides subsetting of data based on the value of a given 108 | ;;; column. To subset based on name, create a name-idx alist and then 109 | ;;; use (aref idx lst) in place of "col" 110 | (define (subset lst index f) 111 | (let ([F (if (or (string? f) (symbol? f) (number? f)) 112 | (λ (x) (equal? x f)) 113 | f)]) 114 | (if (number? index) 115 | (if (or (< index 0) (>= index (length (car lst)))) 116 | (error "Invalid column number") 117 | (filter (lambda (x) (F (list-ref x index))) lst)) 118 | (let* ([header (car lst)] 119 | [fn (cond 120 | [(string? (car header)) string->symbol] 121 | [(symbol? (car header)) identity] 122 | [else (error "Header must be of type string or symbol")])]) 123 | (let* ([header-index (map list (map fn header) (range (length header)))] 124 | [name (aref index header-index)]) 125 | (if name 126 | (cons (car lst) (filter (lambda (x) (F (list-ref x name))) (cdr lst))) 127 | (error "Invalid column name"))))))) 128 | 129 | ;;; Uninformative (i.e., bad) name for a function that allows you to 130 | ;;; extract columns from columnar data (list-of-lists). The short 131 | ;;; (i.e., good) name helps to avoid complex and overly-long commands 132 | ;;; to do this manually. This function expects either (1) that index 133 | ;;; is a number, in which case the corresponding "column" is returned, 134 | ;;; or (2) that index is a symbol. In this situation the first "row" 135 | ;;; of data contains the column names, or "header," and the remaining 136 | ;;; rows contain the data. Row names are accessed as symbols even if 137 | ;;; the actual data contains string headers. `lst` is a list-of-lists, 138 | ;;; as created, for example, by csv->list or read-csv. `name` is a 139 | ;;; symbol of a valid column name contained in the car of `lst`. Only 140 | ;;; the non-header rows of the requested column are returned. 141 | (define ($ lst index) 142 | (if (number? index) 143 | (if (or (< index 0) (>= index (length (car lst)))) 144 | (error "Invalid column number") 145 | (map (λ (x) (list-ref x index)) lst)) 146 | (let* ([header (car lst)] 147 | [fn (cond 148 | [(string? (car header)) string->symbol] 149 | [(symbol? (car header)) identity] 150 | [else (error "Header must be of type string or symbol")])]) 151 | (let* ([header-index (map list (map fn header) (range (length header)))] 152 | [name (aref index header-index)]) 153 | (if name 154 | (map (λ (x) (list-ref x name)) (cdr lst)) 155 | (error "Invalid column name")))))) 156 | 157 | ;;; The group-by included with Racket doesn't quite do what we 158 | ;;; want. We want to be able to take TWO lists, and group list-2 using 159 | ;;; the elements of list-1 as grouping factors. The following function 160 | ;;; provides this. If include-factors? is #t, each factor is included 161 | ;;; as the first element in each grouped sub-list. This enables the 162 | ;;; returned lists to be accessed as an alist. 163 | (define (group-with factors lst [include-factors? #t]) 164 | (let ((tmp (group-by (lambda (x) (car x)) (map list factors lst)))) 165 | (if include-factors? 166 | (map (lambda (x) (append (list (caar x)) (map second x))) tmp) 167 | (map (lambda (x) (map second x)) tmp)))) 168 | 169 | ;;; Aggregate. This is meant to behave similarly to R's aggregate 170 | ;;; function 171 | (define (aggregate f factors lst) 172 | (let ((tmp (group-with factors lst))) 173 | (map (lambda (x) (list (car x) (f (cdr x)))) tmp))) 174 | 175 | ;;; Generating discrete histograms of (sorted!) binned samples should 176 | ;;; be easier. The following generates sorted bins suitable for 177 | ;;; plotting with `discrete-histogram`. This function is similar to 178 | ;;; `samples->hash` but does not return a hash or dotted pairs. The 179 | ;;; return value is a list of (key value) pairs sorted by keys. 180 | ;;; Example: '(3 3 2 1 4 4 4) => '((1 1) (2 1) (3 2) (4 3)) 181 | (define (sorted-counts lst) 182 | (let-values ([(keys values) (count-samples lst)]) 183 | (sort (map list keys values) 184 | (λ (x y) (if (number? (car x)) 185 | (< (car x) (car y)) 186 | (stringlist (in-range (- s-min step-size) s-max step-size))] 221 | [bin-counts (map list bins (map sample-bin-total (bin-samples bins <= s)))]) 222 | (discrete-histogram bin-counts))) 223 | 224 | 225 | ;;; When you have a single list of values, it is useful to be able to 226 | ;;; plot the data as y-values. This requires creating token x values 227 | ;;; with (range (length ys)). Better to make this a short call for 228 | ;;; convenience. Given a list of y values, this returns (x1, y1) pairs 229 | ;;; for plotting 230 | (define (xs ys) 231 | (map list (range (length ys)) ys)) 232 | 233 | ;;; Simple z-transformation. Scales data to mean = 0 and stddev = 1 234 | (define (scale lst) 235 | (let ([lst-mean (mean lst)] 236 | [lst-stddev (stddev lst)]) 237 | (map (λ (x) (/ (- x lst-mean) lst-stddev)) lst))) 238 | 239 | ;;; Calculate logarithms with an arbitrary base 240 | (define (log-base n #:base [base (exp 1)]) 241 | (/ (log n) (log base))) 242 | 243 | ;;; Q-Q Plot. Plots sample quantiles against theoretical quantiles 244 | ;;; from a normal distribution with a mean and standard deviation 245 | ;;; of the sample `lst`. By default, both quantiles are 246 | ;;; z-transformed. Suppress this behavior with #:scale? #f. Returns a 247 | ;;; renderer for use with `plot`, `plot-file`, etc. 248 | (define (qq-plot lst #:scale? [scale? #t]) 249 | (let* ([n (length lst)] 250 | [lst-mean (mean lst)] 251 | [lst-stddev (stddev lst)] 252 | [probs (map (λ (x) (/ x (+ 2 n))) (range 1 (add1 n)))] 253 | [normal-quantiles 254 | (map (λ (x) (inv-cdf (normal-dist lst-mean lst-stddev) x)) probs)] 255 | ;; Scale the data? 256 | [xs (if scale? (scale normal-quantiles) normal-quantiles)] 257 | [ys (if scale? (scale lst) lst)]) 258 | (points (map vector (sort-samples < xs) 259 | (sort-samples < ys))))) 260 | 261 | ;;; Same as qq-plot, but automatically passed the renderer to `plot` 262 | ;;; for quick convenience 263 | (define (qq-plot* lst #:scale? [scale? #t]) 264 | (plot (qq-plot lst #:scale? scale?) 265 | #:x-label "Theoretical Normal Quantiles" 266 | #:y-label "Sample Quantiles")) 267 | 268 | 269 | ;;; Regression solver using linear algebra. 270 | ;;; Returns '(intercept coefficient-1 coefficient-2 ...) 271 | ;;; Example 1: Simple Linear Regression 272 | ;;; Given a list of x values and y values: 273 | ;;; 274 | ;;; (define xs (range 100)) 275 | ;;; (define ys (map + xs (sample (normal-dist 0 30) 100))) 276 | ;;; (let* ([coef (linear-model xs ys)] 277 | ;;; [slope (cadr coef)] 278 | ;;; [intercept (car coef)]) 279 | ;;; (plot (list (points (map vector xs ys)) 280 | ;;; (function (λ (x) (+ (* x slope) intercept)))))) 281 | ;;; 282 | ;;; Example 2: Multiple linear regression. 283 | ;;; Multiple (additive) predictors can be used. With two predictors, 284 | ;;; X1 & X2, each predictor should be a "column" in a list-of-list, 285 | ;;; such as '((X1 X2) (X1 X2) ...). Say we have two predictors, X1 and 286 | ;;; X2, and observed outcome Y: 287 | ;;; 288 | ;;; (define x1 '(52 59 67 73 64 74 54 61 65 46 72)) 289 | ;;; (define x2 '(173 184 194 211 196 220 188 188 207 167 217)) 290 | ;;; (define y '(132 143 153 162 154 168 137 149 159 128 166)) 291 | ;;; (linear-model (map list x1 x2) y) 292 | ;;; ;;; Plot a surface? 293 | ;;; (let* ([coef (linear-model (map list x1 x2) y)] 294 | ;;; [intercept (first coef)] 295 | ;;; [b1 (second coef)] 296 | ;;; [b2 (third coef)]) 297 | ;;; (plot3d (list (points3d (map vector x1 x2 y)) 298 | ;;; (surface3d (λ (x1 x2) (+ intercept (* b1 x1) (* b2 x2))))))) 299 | (define (linear-model xs y) 300 | (let ([X (list*->matrix 301 | (map (λ (x y) (flatten (list x y))) 302 | (build-list (length xs) (const 1)) xs))] 303 | [Y (->col-matrix y)]) 304 | ;; We solve for A, a col-matrix containing [intercept slope] 305 | ;; A = ((X^TX)^-1)X^TY 306 | ;; Where X^T means transpose of X, and ^-1 means inverse 307 | (matrix->list (matrix* 308 | (matrix-inverse (matrix* (matrix-transpose X) X)) 309 | (matrix* (matrix-transpose X) Y))))) 310 | 311 | ;;; Version with rich output. Model parameters and inputed data 312 | ;;; (packaged as matrices) returned as a hash 313 | (define (linear-model* xs ys) 314 | (let ([X (list*->matrix 315 | (map (λ (x y) (flatten (list x y))) 316 | (build-list (length xs) (const 1)) xs))] 317 | [Y (->col-matrix ys)]) 318 | ;; We solve for A, a col-matrix containing [intercept slope] 319 | ;; A = ((X^TX)^-1)X^TY 320 | ;; Where X^T means transpose of X, and ^-1 means inverse 321 | (let* ([coef (matrix* 322 | (matrix-inverse (matrix* (matrix-transpose X) X)) 323 | (matrix* (matrix-transpose X) Y))] 324 | [residuals (matrix- Y (matrix* X coef))] 325 | [n (matrix-num-rows X)] 326 | [p (sub1 (matrix-num-cols X))] 327 | [mse (/ (matrix-ref 328 | (matrix* 329 | (matrix-transpose (matrix- Y (matrix* X coef))) 330 | (matrix- Y (matrix* X coef))) 0 0) 331 | (- n p))] 332 | [root-mse (sqrt mse)]) 333 | ;; Return a hash of model results 334 | (hash 'X X 'Y Y 335 | 'coef (matrix->list coef) 336 | 'residuals (matrix->list residuals) 337 | 'n n 338 | 'p p 339 | 'mse mse 340 | 'root-mse root-mse)))) 341 | 342 | ;;; Chi-square goodness of fit test. lst should contain variables and 343 | ;;; observered frequencies as a list of lists '(("Yes" 45) ("No" 344 | ;;; 37)). p should be a list of hypothesized probabilities, one for 345 | ;;; each variable in lst '(0.50 0.50). The alpha level (default 0.05) 346 | ;;; can be optionally set. 347 | (define (chi-square-goodness lst p #:alpha [alpha 0.05]) 348 | (let* ([observed ($ lst 1)] 349 | [n (sum observed)] 350 | [df (- (length lst) 1)] 351 | [expected (map (λ (x) (* n x)) p)]) 352 | (let ([chisqr (sum (map 353 | (λ (o e) (/ (expt (- o e) 2) e)) 354 | observed expected))] 355 | [criterion (inv-cdf (gamma-dist (/ df 2) 2) alpha #f null)]) 356 | (if (> chisqr criterion) 357 | (make-hash `(('chisqr . ,chisqr) 358 | ('criterion . ,criterion) 359 | ('alpha . ,alpha) 360 | ('df . ,df) 361 | ('result . "significant"))) 362 | (make-hash `(('chisqr . ,chisqr) 363 | ('criterion . ,criterion) 364 | ('alpha . ,alpha) 365 | ('df . ,df) 366 | ('result . "not-significant"))))))) 367 | 368 | 369 | ;;; One-dimensional singular value decomposition using the "Power 370 | ;;; Method". This is used by `svd` to estimate a full singular value 371 | ;;; decomposition. Input `A` should be a matrix. 372 | (define (svd-1d A [epsilon 1e-10]) 373 | (let* ([threshold (- 1 epsilon)] 374 | [m (matrix-num-cols A)] 375 | [rand-norm (sample (normal-dist) m)] 376 | [x-norm (sqrt (apply + (map sqr rand-norm)))] 377 | [initial-vector (->col-matrix (map (λ (x) (/ x x-norm)) rand-norm))] 378 | [B (matrix* (matrix-transpose A) A)]) 379 | (let loop ([previous-v initial-vector]) 380 | (let* ([pre-norm-current (matrix* B previous-v)] 381 | [norm-div (make-matrix m 1 (matrix-norm pre-norm-current))] 382 | [current-v (matrix-map / pre-norm-current norm-div)]) 383 | (if (> (matrix-dot current-v previous-v) threshold) 384 | current-v 385 | (loop current-v)))))) 386 | 387 | ;;; Covariance matrix for lists x and y 388 | (define (cov x y) 389 | (let* ((xbar (mean x)) 390 | (ybar (mean y)) 391 | (xn (length x)) 392 | (yn (length y))) 393 | (list->matrix 394 | 2 2 395 | `(,(/ (apply + (map (λ (x) (* (- x xbar) (- x xbar))) x)) 396 | (sub1 xn)) 397 | ,(/ (apply + (map (λ (x y) (* (- x xbar) (- y ybar))) x y)) 398 | (sub1 xn)) 399 | ,(/ (apply + (map (λ (x y) (* (- y ybar) (- x xbar))) x y)) 400 | (sub1 xn)) 401 | ,(/ (apply + (map (λ (x) (* (- x ybar) (- x ybar))) y)) 402 | (sub1 yn)))))) 403 | 404 | ;;; TEXT ANALYSIS TOOLS 405 | 406 | ;;; Remove URLs in a string 407 | (define (remove-urls str) 408 | (regexp-replace* #px"http[s]?://[^ ]+\\b" str " ")) 409 | 410 | ;;; Remove punctuation in a string (you should typically remove-urls 411 | ;;; before removing punctuation) 412 | (define (remove-punctuation str #:websafe? [websafe? #f]) 413 | (if websafe? 414 | (regexp-replaces str '([#px"&" " "] 415 | [#px"\\|" " "] 416 | [#px"[:;\\.,\\-=`~!]" ""])) 417 | (regexp-replace* #px"\\P{Ll}" str " "))) 418 | 419 | ;;; Remove stopwords. This procedure expects a list of words and a 420 | ;;; stopword lexicon of either 'SMART 'snowball or 'onix. It returns a 421 | ;;; list of non stop-words 422 | (define (remove-stopwords lst #:lexicon [lexicon 'SMART]) 423 | (cond [(equal? lexicon 'SMART) 424 | (filter (λ (word) (not (member (first word) SMART))) lst)] 425 | [(equal? lexicon 'snowball) 426 | (filter (λ (word) (not (member (first word) snowball))) lst)] 427 | [(equal? lexicon 'onix) 428 | (filter (λ (word) (not (member (first word) onix))) lst)])) 429 | 430 | ;;; Extract n-grams from string. Returns list of all possible n-grams 431 | ;;; of size `n` from the string `str` 432 | (define (n-gram str n) 433 | (let loop ([words (string-split str)]) 434 | (if (or (null? words) 435 | (< (length (cdr words)) (sub1 n))) 436 | '() 437 | (cons (append (take words 1) (take (drop words 1) (sub1 n))) 438 | (loop (cdr words)))))) 439 | 440 | ;;; Convert text string into a list-of-lists counting the number of 441 | ;;; occurences for each token/word. 442 | (define (document->tokens str #:sort? [sort? #f]) 443 | (let-values ([(x y) (count-samples (string-split str))]) 444 | (if sort? 445 | (sort (map list x y) (λ (x y) (> (second x) (second y)))) 446 | (map list x y)))) 447 | 448 | ;;; Calculates the term-document matrix for the list of documents 449 | ;;; contained in corpus. Returns a list including an ordered list of 450 | ;;; terms (words) that correspond to the rows of the tdm that is also 451 | ;;; returned. corpus is one or more lists, with each list as returned 452 | ;;; by `document->tokens` 453 | (define (tdm . corpus) 454 | ;;; Create a unique list of items 455 | (define (unique lst) (remove-duplicates lst)) 456 | 457 | ;;; Create a hash of zeroed-out values. This is used to ensure that 458 | ;;; each document has a value of zero for words contained in other 459 | ;;; documents, but not in itself. 460 | (define (make-zeros-hash keys) 461 | (let ([n (length keys)]) 462 | (make-immutable-hash (map list keys (build-list n (λ (x) 0)))))) 463 | 464 | ;;; Turn a single document hash into one that contains all words 465 | ;;; across all documents 466 | (define (add-missing-terms hsh all-words) 467 | (hash-union hsh 468 | (make-zeros-hash all-words) 469 | #:combine/key (λ (k v1 v2) v1))) 470 | 471 | ;; Construct the term-document-matrix 472 | (let* ([num-docs (length corpus)] 473 | [all-words (unique (apply append (map (λ (x) ($ x 0)) corpus)))] 474 | [tdm-hash 475 | (apply 476 | hash-union 477 | (map (λ (document) 478 | (add-missing-terms (make-immutable-hash document) 479 | all-words)) 480 | corpus) 481 | #:combine/key (λ (k v1 v2) (append v1 v2)))]) 482 | ;; We have the raw tdm counts. We normalize and turn into a tf-idf 483 | ;; matrix 484 | (let* ([raw-tdm (list*->matrix (hash-values tdm-hash))] 485 | ;; How frequently each terms appears in a document, 486 | ;; normalized 487 | [tf (matrix-normalize-cols raw-tdm 1)] 488 | ;; Number of documents containing each term 489 | [docs-with-term (matrix-sum 490 | (matrix-cols 491 | (matrix-map (λ (x) (if (equal? x 0) 0 1)) 492 | raw-tdm)))] 493 | ;; idf 494 | [temp (matrix-map 495 | (λ (x) (log-base (/ num-docs x) #:base 10)) 496 | docs-with-term)] 497 | [idf (matrix-augment (make-list num-docs temp))]) 498 | (list 499 | ;; Ordered list of terms 500 | (hash-keys tdm-hash) 501 | ;; tf-idf, with row order matching the ordered list of terms 502 | ;; also returned 503 | (matrix-map * tf idf))))) 504 | 505 | ;;; Same as tdm, but with documents returned as rows and terms as columns. 506 | (define (dtm . corpus) 507 | (let ([temp (apply tdm corpus)]) 508 | ;; dtm is simply the transpose of the tdm 509 | (list 510 | ;; Ordered list of terms 511 | (first temp) 512 | ;; tf-idf in document-term-matrix format 513 | (matrix-transpose (second temp))))) 514 | 515 | ;;; Cosine similarity for two vectors (row matrices) 516 | (define (cosine-similarity v1 v2) 517 | (/ (matrix-dot v1 v2) 518 | (* (sqrt (matrix-dot v1 v1)) 519 | (sqrt (matrix-dot v2 v2))))) 520 | 521 | ;;; Convenience function for reading a corpus of files contained in a 522 | ;;; specified directory and converting each to a list of strings. 523 | (define (directory->strings path [extensions '(".txt")]) 524 | ;; Helper function for finding valid files 525 | (define (file-list path) 526 | (find-files (λ (x) (member (path-get-extension x) 527 | (map string->bytes/utf-8 extensions))) 528 | (expand-user-path path))) 529 | (if (directory-exists? (expand-user-path path)) 530 | (let ([file-list (file-list path)]) 531 | (map (λ (file) 532 | (file->string file)) 533 | file-list)) 534 | ;; Hmm, directory doesn't seem to exist 535 | (raise-argument-error 'directory->strings 536 | "valid-directory" 537 | path))) 538 | 539 | 540 | ;;; SENTIMENT ANALYSIS TOOLS 541 | 542 | ;;; Sentiment lexicons 543 | ;; (define nrc (with-input-from-file "./lexicons/nrc-lexicon" (λ () (read)))) 544 | ;; (define bing (with-input-from-file "./lexicons/bing-lexicon" (λ () (read)))) 545 | ;; (define AFINN (with-input-from-file "./lexicons/AFINN-lexicon" (λ () (read)))) 546 | 547 | 548 | ;;; Convert a token/word into a sentiment score. Lexicon can be either 549 | ;;; (1) 'nrc : returns emotional labels 550 | ;;; (2) 'bing : returns "positive" or "negative" 551 | ;;; (3) 'AFINN : returns a -4 to +4 numerical score 552 | (define (token->sentiment token #:lexicon [lexicon 'nrc]) 553 | (cond [(equal? lexicon 'nrc) 554 | (let ([results (subset nrc 'word (λ (x) (string=? x token)))]) 555 | (if (> (length results) 1) 556 | (drop (map (λ (x) (list (first x) (second x))) results) 1) 557 | '()))] 558 | [(equal? lexicon 'bing) 559 | (let ([results (subset bing 'word (λ (x) (string=? x token)))]) 560 | (if (> (length results) 1) 561 | (drop (map (λ (x) (list (first x) (second x))) results) 1) 562 | '()))] 563 | [else 564 | (let ([results (subset AFINN 'word (λ (x) (string=? x token)))]) 565 | (if (> (length results) 1) 566 | (drop (map (λ (x) (list (first x) (string->number (fourth x)))) results) 1) 567 | (list (list token 0))))])) 568 | 569 | ;;; Takes as input a list of pairs of the type (string number), such 570 | ;;; as output by document->tokens where string is a word from a text 571 | ;;; and number is the number of times it occurs in the 572 | ;;; document. Lexicon can be either 573 | ;;; (1) 'nrc : returns emotional labels 574 | ;;; (2) 'bing : returns "positive" or "negative" 575 | ;;; (3) 'AFINN : returns a -4 to +4 numerical score 576 | (define (list->sentiment lst #:lexicon [lexicon 'nrc]) 577 | (define (pack-sentiment lst lexicon) 578 | (apply append (list '("word" "sentiment" "freq")) 579 | (map (λ (x) 580 | (let ([result (token->sentiment (first x) #:lexicon lexicon)]) 581 | (map (λ (y) (append y (list (second x)))) result))) 582 | lst))) 583 | (let ([sentiment (pack-sentiment lst lexicon)]) 584 | (if (> (length sentiment) 1) 585 | sentiment 586 | '()))) 587 | 588 | ;;; Example workflow: 589 | ;;; Read a document from file into a string: 590 | ;;; (define doc (file->string "my-file.txt")) 591 | ;;; Count number of each token/word 592 | ;;; (define words (document->tokens doc #:sort? #t)) 593 | ;;; Determine total sentiment score 594 | ;;; (apply + (list->sentiment words #:lexicon 'AFINN)) 595 | ;;; 596 | ;;; OR, count positive/negative occurences 597 | ;;; (sorted-counts (filter (λ (x) x) (list->sentiment words #:lexicon 'bing))) 598 | ;;; or plot the breakdown 599 | ;;; (plot (discrete-histogram 600 | ;;; (sorted-counts (filter (λ (x) x) (list->sentiment words #:lexicon 'bing))))) 601 | ;;; 602 | ;;; OR plot breakdown of emotional labels using nrc lexicon 603 | ;;; (parameterize ((plot-width 800)) 604 | ;;; (plot (discrete-histogram 605 | ;;; (sorted-counts (filter (λ (x) x) (list->sentiment words #:lexicon 'nrc)))))) 606 | 607 | ;;; End of file data-science.rkt 608 | 609 | --------------------------------------------------------------------------------