Month: November 2009

Decorators: Python nisse functions.

Posted on

As we are entering the yule it might be time to give an example of the Python programming language equivalent of a yule-nisse: a decorator. A nisse might playfully tease others. Below the “nisse” decorator teases the “add” function and change its behavior:

class nisse(object):    def __init__(self, f):        pass    def __call__(self, x, y):        print 'h??h??'        return x+y+1def add(x,y):    return x+yadd(2,2)@nissedef add(x,y):    return x+yadd(2,2)

When “add(2,2)” is called the first time the result will be 4. The next time with the “nisse” the result will be 5.

23 year in coma and then in headlines.

Posted on Updated on

Rom Houben was thought to have been in coma for around 20 years but then Steven Laureys brain scanned him with positron emission tomography and found that he was minimally conscious. From a German news article it gets into English news and further even to the front page of a Danish tabloid. And the news media had citations from Rom himself: So he can communicate with complete sentences! That is something of a story.

I heard of this story and found that it already was on Wikipedia, where on Rom Houben’s page one could read a section called “controversy”. A video was linked from the Wikipedia page and it clearly showed Rom communicating via Facilitated Communication (FC) (p?? dansk: staveplade). Now FC has exceptionally low standing in the scientific community, and immediately that would call the whole story into question. I heard Steven Laureys in one scientific conference and he seemed to me to be an ok guy—not one that would start using FC. But this story could undermine his credibility. Anibal from Spain, that I follow on Twitter, pointed me to the an entry in Neurologica Blog where commentors were also very sceptical. But one—presumably Flemish speaking—commentor pointed to a recent Belgian news article where Steven Laureys had spoken. The commentor translated it to English, and according to this Steven Laureys says:

That (FC) is a debate that troubles me much more. I myself am sceptical, and that kind of facilitated communication still has a bad reputation, and rightly so. I’m not part of that, and have never suggested using it.

So it seems the news media made this story big by not being critical about the FC. And Wikipedia is more credible?

Twitter text mining for sentiment analysis of COP15

Posted on Updated on

Sentimentanalysis

In the project Responsible Business in the Blogosphere between Copenhagen Business School and Technical University of Denmark we will try to use text mining on blogs for computerized analysis of so-called corporate social responsibility (CSR). Twitter provides a convenient interface for downloading the tweets on its site and as a start on the project I tried to see how this microblogging service could be used in sentiment and topic analyses. A prototype is now running from the rb.imm.dtu.dk/base Web server, and even a rudimentary sentiment analysis seems to find that for example the company Novo Nordisk has more positive tweets than for example Pfizer has.

As of ultimo November 2009 I have put a sentiment analysis of tweets relating to (United Nations Climate Change Conference (COP15) on the main page. It shows a “barometer” reflecting the ratio of positive and negative tweets. The negative tweets may for example be from twitters pessimistic about how we can solve negative consequences of human impact or they may be from twitters hostile to the COP15 meeting. Positive tweets may for example be from twitters excited about going to Copenhagen or from twitters expressing hope.

A positive example (slightly edited):

Barack Obama to attend Copenhagen climate summit. Ah, that’s better news – hope he brings good US stance

A negative one (also slightly edited):

I Hate Al Gore ?? Global Warming Fraud Exposed as Copenhagen Approaches

It will be interesting to see the development of sentiment related to COP15, especially during the conference days 7 December to 18 December 2009.

Using Google Web-service to keep track of scientific citations to me

Posted on Updated on

Googlescholar

Google Scholar allows me to see which scientific papers cite my scientific papers. However, it does not order them according to date so I cannot easily identify the most recent papers with cite to me.

One way to somehow identify recent citations is to use the “as_ylo” parameter available in the advanced search. With as_ylo=2009 only the papers published in 2009 are shown to the given query. Combining that with a negative ‘author:’ query gets you some of the way, e.g., with “Nielsen FA” -author:”FA Nielsen” (included as_ylo=2009) I find papers from 2009 mentioning ‘Nielsen FA’ that are not authored by me.

To get a higher retrieval rate I list some of the different variations of my name in the query. The real query is then (abbreviated) “Nielsen FA” OR … -author:”FA Nielsen” …!

As the year progresses one gets more and more citations and it becomes difficult to identify the new ones. Using the real-time search in the standard Google Web search one may try an alternative way. Restricting the search to PDF files and real-time search for past month data may result in newer data, – but probably also lacking papers from publishers letting Google Scholar in but Google Web out: “Nielsen FA” OR … filetype:pdf

It is possible that Google Alerts also can help.

2010-11-25: Typo correction