# Computational Pragmatics
For several decades, the study of language use and contextually-mitigated meaning --- the study of pragmatics ---has been regarded as a wastebasket in which to dump unexplainable loose ends in service of more rigorous formal analyses. This view of pragmatics is no longer adequate. Owing to a dedicated shift towards experimental studies of pragmatic phenomena and the rise of suitable formal frameworks, a data-driven computational pragmatics is now possible. This course introduces ideas, experimental techniques and programming tools that feed recent efforts to model pragmatic inferences as probabilistic social cognition, in which interlocutors reason about each other's choice of utterance and interpretation. We will introduce the Rational Speech Act model (Frank & Goodman 2012) and several of its extensions to cover such diverse phenomena as conversational implicatures, context-dependence, non-literal interpretations (hyperbole, metaphor, ...), or politeness. We will discuss implementations of these models in WebPPL, a general-purpose probabilistic programming language. We demonstrate how computational pragmatic models can be evaluated against experimental data using Bayesian data analysis within WebPPL. In practical course units, participants will be able to explore model implementations and data analysis in an easily accessible browser-based implementation of WebPPL.
- Instructors: Michael Franke and Michael Henry ("MH") Tessler
- Time: 9:00-10:30
- Location: Bldg 24.21 Room 24.21.U1.21
- Course WebBook: [Probabilistic Language Understanding](https://michael-franke.github.io/probLang/) (PLU)
- Supplementary book: [Bayesian Data Analysis using Probabilistic Programs](https://mhtess.github.io/bdappl/) (BDAPPL)
Take the [end of course survey!](https://docs.google.com/forms/d/e/1FAIpQLSfCo9NteiEXAj0lq2q7hjVRhczgQxz139yzU_yquCYukHOwEg/viewform?usp=sf_link)
## Schedule
- Day 1: Intro to pragmatics, begin vanilla RSA
- [[slides]](http://stanford.edu/~mtessler/short-courses/2017-computational-pragmatics/slides/CompPrag_intro_DGfS-FS-2017.pdf)
- [PLU: Intro to RSA](https://michael-franke.github.io/probLang/chapters/01-introduction.html) (up to "Pragmatic speakers")
- Day 2: Probabilistic Programming using WebPPL. Bayesian Inference.
- [JavaScript / WebPPL basics](http://probmods.org/chapters/13-appendix-js-basics.html)
- [BDAPPL: Introduction to randomness in programs](https://mhtess.github.io/bdappl/chapters/01-introduction.html)
- [BDAPPL: Constructing posterior distributions](https://mhtess.github.io/bdappl/chapters/02-buildingModels.html)
- Day 3: Two views of probabilistic programs: RSA and BDA
- Finish [PLU: Vanilla RSA](https://michael-franke.github.io/probLang/chapters/01-introduction.html)
- Associated paper: [Frank & Goodman (2012)](https://web.stanford.edu/~ngoodman/papers/FrankGoodman-Science2012.pdf)
- Day 4: Bayesian Data Analysis
- [PLU: BDA Appendix](https://michael-franke.github.io/probLang/chapters/app-02-BDA.html) (up to "Full example")
- Day 5: RSA for scalar implicature ("Some of the students failed.") and epistemic SI (when speaker doesn't know if *all*)
- [PLU: Enriching literal interpretations](https://michael-franke.github.io/probLang/chapters/02-pragmatics.html)
- Associated paper: [Goodman & Stuhlmueller (2013)](https://web.stanford.edu/~ngoodman/papers/GS-TopiCS-2013.pdf)
- Day 6: Non-literal language (Hyperbole, Metaphor, Sarcasm)
- [PLU: Inferring the Question-Under-Discussion](https://michael-franke.github.io/probLang/chapters/03-nonliteral.html)
- Hyperbole paper: [Kao et al., (2014)](http://cocolab.stanford.edu/papers/KaoEtAl2014-PNAS.pdf)
- Metaphor paper: [Kao et al., (2014)](http://cocolab.stanford.edu/papers/KaoEtAl2014-Cogsci.pdf)
- Irony paper: [Kao & Goodman (2015)](http://cocolab.stanford.edu/papers/KaoEtAl2015-Cogsci.pdf)
- Day 7: Politeness ("Your lecture was interesting!")
- [PLU: Social reasoning about social reasoning](https://michael-franke.github.io/probLang/chapters/08-politeness.html)
- White lies paper: [Yoon, Tessler, et al. (2016)](http://langcog.stanford.edu/papers_new/yoon-2016-cogsci.pdf)
- Indirectness paper: [Yoon et al., (2017)](http://langcog.stanford.edu/papers_new/yoon-2017-cogsci.pdf)
- Day 8: Generics ("Birds lay eggs" vs. "Birds are female")
- [PLU: Extending our models of predication](https://michael-franke.github.io/probLang/chapters/07-generics.html)
- Generics manuscript: [Tessler & Goodman (arXiv)](https://arxiv.org/abs/1608.02926)
- Day 9: Comparing models
- Day 10: Outlook / What have we done?
## Resources
### Probabilistic Modeling of Cognition and Language
- [Pragmatic language interpretation as probabilistic inference](http://langcog.stanford.edu/papers_new/goodman-2016-underrev.pdf): A recent review of the Rational Speech Act framework
- [Probabilistic pragmatics, or why Bayes' rule is probably important for pragmatics](https://www.degruyter.com/view/j/zfsw.2016.35.issue-1/zfs-2016-0002/zfs-2016-0002.xml): Position piece by Michael Franke and Gerhard Jaeger
- [Probabilistic Models of Cognition](http://probmods.org/): An introduction to computational cognitive science and the probabilistic programming language WebPPL
- [Modeling Agents with Probabilistic Programs](http://agentmodels.org): An introduction to formal models of rational agents using WebPPL
- [Forest](http://forestdb.org): A Repository for probabilistic models
### Probabilistic Programming
- [The Design and Implementation of Probabilistic Programming Languages](http://dippl.org): An introduction to probabilistic programming languages, WebPPL in particular
- [webppl.org](http://webppl.org): An online editor for WebPPL
- [WebPPL documentation](http://webppl.readthedocs.io/en/master/)
- [WebPPL-viz](http://probmods.github.io/webppl-viz/): A summary of the vizualization options in WebPPL
- [RWebPPL](https://github.com/mhtess/rwebppl): If you would rather use WebPPL within R
- [WebPPL Tutorials](https://mhtess.github.io/bdappl/): Basic tutorials for WebPPL