mardi 20 mars 2012

Conférence au BPI, "Le parler jeunes. Un danger pour la langue française?"

Dans le cadre de la "semaine de la langue française", une conférence a été animé au BPI par Cyril Trimaille (avec Françoise Gadet, Maria Candea, Marie-Madeleine Bertucci et Boris Seguin) sur "Le parler des jeunes". Sous-titre: "Un danger pour la langue française?"

Une vidéo de la conférence a été transmis en direct vis le site web, et, si je ne me trompe pas, un enregistrement sera disponible dans les archives sonores de la BPI la semaine prochaine.

Ce contexte grand-public a été l'occasion de faire un tour rapide des filières de recherche qui prennent comme objet cette variation linguistique qu'on appel le "parler jeunes".

C'était aussi l'occasion pour des échanges entre universitaires et "grand public" - chose qui a, je crois, été bien enrichissement pour tout le monde.

Quelques commentaires entendus (est-ce que je les ai bien notés? on verra dans une semaine avec l'audio!):
"Je trouve ça pas très bien [...] la langue française est en déclin [...] c'est les chat est les sms"
"L'avenir de la langue française se trouve en Afrique"
"Si ma langue maternelle était l'anglais je serais plus inquiète" (ça, je n'ai pas compris..)

vendredi 16 mars 2012

Twitter-scraping with Python for Dummies (in Windows)

I'm ok with Python but it took me a while to get this set up, and all the "easy guides" seem to start from Linux.
Compiled from a couple of pages, and some trial and error.


You will need:




Step 1: Get your Twitter Api key
You will need to be a twitter user to get an api key. You will need an api key for some of the things you'll do later. You don't absolutely need to do this step right now but it's probably eaiser.
This explains the process pretty clearly When you're filling out the form, it doesn't matter what you put in the fields for "app name" and "website", etc.
You will also need the access token, so click on the button at the bottom of the page to get that.

Also, go into your settings (there should be a tab at the top of the page), scroll down to 'Application Type' and choose 'Read and Write'. This will mean you can update your twitter status, and things like that. (Then, obviously, scroll down and click on 'Update this Twitter application's settings')
If you'd already created your access token before doing this, you will need to re-do that to update it with the new permissions. Click 'Recreate my access token'.


Step 2: Download the python wrapper for the twitter api and its dependencies 
Open up a Command Prompt
( Start->Accessories->Command Prompt )
Type: cd c:\Python27\scripts  

Type:  easy_install simplejson
(wait. read what's on the screen - hopefully not an error)

Type: easy_install httplib2
(wait, etc)

Type: easy_install oauth2
(wait, etc)


Type: easy_install twitter
(wait, etc - and if that doesn't work, try: easy_install pip
then: pip install twitter )


You should now be good to go.



Step 2: Setting up the twitter api wrapper in python
Open up a Python shell window. You should get this if you go :
Start -> Programs -> Python27 -> IDLE (Python Gui)
It should look like this:


Type:  import twitter
(nothing happens)

Type: api = twitter.Api()
(nothing happens)

We're now referring to the official documentation here.

Type:  
api = twitter.Api(consumer_key='consumer_key', 
consumer_secret='consumer_secret', 
access_token_key='access_token', 
access_token_secret='access_token_secret')
- Except that where it says 'consumer_secret', 'access_token', etc (everything with the single quote marks), write in the Consumer Key / Consumer Secret / etc that you got in Step 1. Keep the quote marks.
Also, you don't need to press Enter between these lines, but it doesn't matter if you do.

To check that that has worked, type:
print api.VerifyCredentials()
When you press Enter you should get a bunch of text (hopefully not any errors).

What would be a good idea right now is to save this script, so that you don't have to go back and remember/retype all of that next time you want to work.
(In the Python Shell window,  File->Save)


Step 4: Try a few things out
(These are from the Google Code page):


allstatuses = api.GetPublicTimeline()
print [s.user.name for s in statuses]


statuses = api.GetUserTimeline("user")
(The username is text, so must be in quote marks)

friends = api.GetFriends("user")
print [f.name for f in friends]
(For list of people the user is "following")


and... away you go. full documentation here.

mercredi 14 mars 2012

Glottopol n°10, "Regards sur l'internet, dans ses dimensions langagières. Penser les continuités et discontinuités"

Le numéro 10 (2007) de Glottopol (une revue sociolinguistique en ligne de l'Université de Rouen) a été dédié aux dimensions langagiers de l'internet, en hommage à Jacques Anis.

Deux articles m'ont intéressés particulièrement:


Michel Marcoccia, Nadia Gauducheau (Tech-CICO (ICD, CNRS / Université de technologie de Troyes)) : L'analyse du rôle des smileys en production et en réception : un retour sur la question de l'oralité des écrits numériques


(Ici j'ai quelques remarques critiques, qui seront à venir)



Remi Adam Van Compernolle, Lawrence Williams (University of North Texas): De l'oral à l'électronique : la variation orthographique comme ressource sociostylistique et pragmatique dans le français électronique

Les auteurs comparent trois types de discours électroniques (l'IRC, les forums de discussion et le "clavardage modéré") les uns des autres, et avec du français parlé informel. L'étude se focalise sur la variation dans l'orthographe ou prononciation des séquences équivalents à "il y a", "il faut", "tu es", "tu as", "c'est" et "j'ai". Les résultats montrent que ces discours se différent les uns des autres, et suggèrent que l'IRC ressemble le plus au français parlé informel.

Le point d’intérêt pour moi est la sélection des séquences ("il y a", "il faut", etc) -- me suggérant qu'ils peuvent être une piste d'étude promettant.

jeudi 1 mars 2012

An afternoon in style on the Internet

Over at Language Log, Mark Liberman writes of the "serendipitous conversational cross-fertilization comes from random encounters in the corridors and cafeterias of the internet". And the example he chooses happens to be about stylistics and measuring text similarity! Serendipitous indeed.

A couple of useful links/references (blog and academic):

Ted Underwood, "The differentiation of literary and nonliterary diction, 1700-1900", (Blog: The Stone and the Shell, 26 feb 2012)
- Ted Underwood diachronically compares literary text genres (poetry, drama, fiction) with non-fiction. Comparing word-frequency similarity, he finds that over time (1700 to 1900) the literary genres became less and less similar to non-fiction.

Interestingly, he also finds that, over that time period, non-fiction changed the most in relation to itself - that is, it changed the most as a genre. (He discusses some of the possible reasons for this so I won't repeat them here)

As Mark Liberman mentions, an obvious limitation is that this measure of similarity will depend on topic as well as style or diction.
I still need to go back to this later to look again at the stats and details.



Arvind Narayanan in "Is Writing Style Sufficient to Deanonymize Material Posted Online?" (Blog: 33 Bits of Entropy, 20 feb 2012) (blog also links to draft of forthcoming paper, "On the Feasibility of Internet-Scale Author Identification") looks at identifying blog authors:
"We were able to obtain about 2,000 pairs (and a few triples, etc.) of blogs, each pair written by the same author [...]. We added these blogs to the Spinn3r blog dataset to bring the total to 100,000. Using this data, we performed experiments as follows: remove one of a pair of blogs written by the same author, and use it as unlabeled text. The goal is to find the other blog written by the same author. We call this blog-to-blog matching. Note that although the number of blog pairs is only a few thousand, we match each anonymous blog against all 99,999 other blogs."

Take-aways: 
- I discovered the term "stylometry", which is more specific and useful than what I had been calling "sort of like forensic linguistics".
- I have a lot of reading to do on stylistics (and stylometrics). Because basically all I had so far was Coupland (2007) Style: Language Variation and Identity, Cambridge University Press. [reviews: 1, 2]



AND THEN

Two minutes on Twitter means I come across this, from Google ResearchQuantifying comedy on YouTube: why the number of o’s in your LOL matter, looking at the comments under YouTube videos. Variations in these "laughs" (lol, loool, aha, hahaha, etc... not to mention the recent comeback of "mwahaha") is exactly one of the things I was counting on looking at - my hypothesis is that the choice of one of these will strongly depend on the community context in which we are speaking. For example, we know that for some people, "lol" is totally uncool and would only be used ironically, in the form of "LOL" or "LULZ" in an otherwise capitalisation-free discourse.
The different types, and amount of, emphasis we might use (as the post describes, "e.g. capitalization (LOL), elongation (loooooool), repetition (lolololol), exclamation (lolllll!!!!!)") is another variable.

Google's research question is different: They're looking at to what extent this variation might be an indicator of the funniness rating of the video by the viewer. Though they admit that "funniness" is a difficult question (humour preference is subjective), they apparently have some human-annotated data to train classifiers with. Also, they took video tags (and, presumably, the video title) into account. And some audio-visual features. So, that sounds like fun.
Just when I'm wondering why I can't intern at Google, here are two things I need to look into:
1) What is a "passive-aggressive" ranking algorithm? Does it leave notes on the fridge rather than speaking to you, or does it secretly give items controversial rankings? Maybe I need to watch this.
2) "human-annotated pairwise ground truth" - I've assumed this refers to a human-annotated training corpus, but I haven't heard of "ground truth" before. Hmm.

And their references (copy-pasted):

Opinion Mining and Sentiment Analysis,” by Bo Pang and Lillian Lee.
A Great Catchy Name: Semi-Supervised Recognition of Sarcastic Sentences in Online Product Reviews,” by Oren Tsur, Dmitry Davidov, and Ari Rappoport.
That’s What She Said: Double Entendre Identification,” by Chloe Kiddon and Yuriy Brun.


Plus, from the comments:

Biel, J-I. and Gatica-Perez, D. VlogSense: Conversational Behavior and Social Attention in YouTube. ACM Trans. Multimedia Comput. Commun. Appl. 2, 3, Article 1 (May 2010)
Biel, J-I., Aran, O., and Gatica-Perez, D. "You Are Known by How You Vlog: Personality Impressions and Nonverbal Behavior in YouTube".In  [I think] ICWSMThe AAAI Press (2011) .