Friday, January 21, 2022

Doggerland

 Between the cold and the covid restriction, I get to watch a lot of YouTube.

Below, a really interesting overview of early humans entering Scandinavia. 

Didn't really understand about Doggerland before thi; makes me realize I have

been out of school for a long time. Awesome!!



                                                          
                                                        *     *     * 

I would have aprreciated knowing the following, as a child:



Thursday, January 20, 2022

LeDev

 From Le Devoir:

                                                                                                       ...


That said, there is no real reason for demonizing the unvaccinated.

One might take a sociological stance on the issue. Like, not

everyone adopts novelty at the same rate and there is no reason

to assume the unvaccinated are malevolent. I don't have a shaved

haircut but my daughter does. Perfectly normal situation. The vaccination

effort we are living through now seeks to simulate natural immunity

in the population because we are dealing with high population spread

of airborne diseases. That's the truth of the situation.

Punkt

 Couldn't finish yesterday's entry for CS50 AI properly because

I couldn't manage to download the python tokenizer (charmingly 

named 'punkt'). In the cool light of morning today, I solved it.


Forget pip, just go on the python interpreter in Command Prompt.

One needs to locate 'punkt' from the list of options.



*     *     *
Given the corpus of the works of Sir A.C. Doyle,  Sherlock Holmes, print out

the 10 most used ngrams (here, I asked for 1 and 4).




😀




Wednesday, January 19, 2022

All of Shakespeare

 Ploughing through on CS50 AI.






So how does a computer apprehend the meaning of texts. Short
answer: it doesn't really. One ends up instructing the computer to
tokenize a text in a certain way - that is, work with words or other units -
and train to create a model. Below, Markovify is given access to the entire
corpus of Shakespeare's works, and asked to produce 5 sentences on a 
Markov chain model. Kinda silly result, but each word proposed does follow
the previous two somewhere in Shakespeare...






                                                                *     *     *

A more mudane problem, which a computer can handle, is teling whether 

an email is serious or spam; or whether a product review is favourable or

not.

One gives the computer a set of reviews to train on, and build a model

on word frequency. The computer is told which reviews are favourable, and 

which are not. It is then asked to classify a new review.




A naive Baysian analysis, multiplying the probabilities on major words, gives

a 68% chance of being favourable to "My grandson loved it". Good work, nltk!!

Natural Language Toolkit











Numbers

 Been google - ing again, this time on the great Boris Johnson Party

Saga. Seems there are now seven documented Downing Street boozy

work events, and possibly more to come. OOOOOh!


The March 20, 2020 garden party got me thinking. Didn't Mr Johnson get

Covid himself in March. As I recalled, he had shown great bravado in carrying

on with public engagements in the days up to his symptoms. Turns out that

he started isolating one week after the party, and ended up in hospital

- and eventually on a respirator - one week after that. So how did the other

party goers fare!?


To be fair, our understanding of Covid was murky in those early days. Particularly

on the concept of 'getting it'. By now I would guess the virus is everywhere and we 

are all dealing with it all the time; the test picks up when we become capable of infecting

others from the virus we reproduce ourselves. 


But still, March 20 was also the date the British government closed all schools in 

England.


So what was going on there: hanging on to normalcy, accepting the inevitable, going

down with the ship in style?? A bit of all that, I would think. The really bad numbers had yet

to come; but come they did.




Monday, January 17, 2022

TammyL

 


Been following Tammy Lemons and her journal of dieting
difficulties. She does seem to have a full complement of
health care professionals to help her, and I in no way want to
interfere with that.  But I would have one suggestion which I think
might be helpful to her.

Tammy lives alone (with four cats). I think that forcing herself to keep
certain social practices might help. In particular, I would suggest that
she never eat in bed. Plan and eat whatever you will, but consume it at
a dining table, with knife, fork, sparkling glass, napkins and so on. That's 
all! No food in the bedroom, ever. Give it two weeks...

Why make this suggestion. Because a sugar and ice cream habit seems to 
hanker back to early childhood and falling asleep after sweet milk. No!!

Sunday, January 16, 2022

Natural Language

Back to CS50 AI for the last lecture, on Language:


 

The above list shows some of the tasks related to language

that AI has come to deal with. All require a consideration of

both syntax(the word order aspect of grammar) and semantics (meaning).


The cornerstone to how computers will approach things is Chomsky's

notion of context-free grammar and normal form ((CNF).  One builds things up

from the simplest - a noun verb combination - to more complex.


Using Python's natural language tool kit, the program is able to parse

sentences constructed from the given vocabulary. (News to me, French

now has the verb 'parser' to describe how computers propose  syntactic

analysis). A terminal symbol is a word, a non-terminal symbol is a word species 

such as noun, verb, determinative..., verbal phrase.


Program 0 reads simple sentences; program1 more complex but still has limits...










                                                                 *     *     *


Zero
                                                


One: