Skip to content

Instantly share code, notes, and snippets.

View xiaoouwang's full-sized avatar
🎯
Focusing

Xiaoou WANG xiaoouwang

🎯
Focusing
View GitHub Profile
@xiaoouwang
xiaoouwang / error_statistics.ipynb
Last active November 10, 2021 13:18
error_statistics.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xiaoouwang
xiaoouwang / negation.ipynb
Last active May 9, 2021 17:00
bert_negation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xiaoouwang
xiaoouwang / 01_play_with_camembert_and_flaubert.ipynb
Last active May 7, 2021 20:45
01_play_with_camembert_and_flaubert.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xiaoouwang
xiaoouwang / 01_classification_prenoms.ipynb
Created March 22, 2021 12:05
projetTal1_classification_prenoms
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xiaoouwang
xiaoouwang / lemondeScraper.py
Last active January 18, 2024 13:23
Complete tutorial on scraping French news from le monde ❤️
# Author: Xiaoou Wang [linkedin](https://www.linkedin.com/in/xiaoou-wang)/[email](mailto:xiaoouwangfrance@gmail.com)
# https://xiaoouwang.medium.com/complete-tutorial-on-scraping-french-news-from-le-monde-%EF%B8%8F-4fa92bc0a07b
# Have a look at https://soshace.com/responsible-web-scraping-gathering-data-ethically-and-legally/ before using the code.
import os # helper functions like check file exists
import datetime # automatic file name
import requests # the following imports are common web scraping bundle
from urllib.request import urlopen # standard python module
from bs4 import BeautifulSoup
from urllib.error import HTTPError
from collections import defaultdict
@xiaoouwang
xiaoouwang / wordvector in gensim.ipynb
Created February 11, 2021 11:04
a minimal example of word vector in gensim
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xiaoouwang
xiaoouwang / Tuto_plongement_lexical.ipynb
Last active March 9, 2024 18:51
Tuto_plongement_lexical.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xiaoouwang
xiaoouwang / t_test_1.ipynb
Last active January 6, 2023 15:34
Independent t-test by hand in Python: with equal sample sizes and variance
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xiaoouwang
xiaoouwang / comprendre_str_repr.py
Created December 23, 2020 11:33
Comprendre __str__ en Python (et l'avantage de __repr__)
# https://xiaoouwang.medium.com/comprendre-la-m%C3%A9thode-str-en-python-et-lavantage-de-repr-d40fceb833a1
# Author: Xiaoou Wang, Master's student in natural language processing looking for a phd position/contrat cifre. https://www.linkedin.com/in/xiaoou-wang/
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
p1 = Person("John", 36)
print(p1) # <__main__.Animal object at 0x7f9060250410>
@xiaoouwang
xiaoouwang / bashHistory.sh
Last active January 16, 2021 10:24
bash command history
# Author: Xiaoou Wang, Master’s student in natural language processing looking for a phd position/contrat cifre.
# https://xiaoouwang.medium.com/get-readable-bash-command-history-with-cut-and-vscode-4eb8d56f38b4
history | tail -n 15 # show the last 15 commands
echo "abcdefghi" | cut -c2-6 # extract the 2nd to the 6th character 
# output = bcdef
echo "a-b-c" | cut -d'-' -f2 # split the string into 3 parts and get the 2nd part
# output = b
history | cut -d' ' -f4- | tail -n 15 # separate using space, get the 4th to nth column, get the last 15 commands
history | cut -d' ' -f4- | tail -n 15 | code - # show the results in vsc
history | grep “python” | cut -d' ' -f 4- | tail -n 15 | code - # Seach a command containing specific string