Skip to content

Commit

Permalink
nlp
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mhamdi committed Dec 22, 2024
1 parent 355f034 commit fa96da8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
29 changes: 11 additions & 18 deletions Codes/Julia/Part-3/nlp/nlp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "37257731-6782-49b3-a59e-5f772c9cf7d6",
"metadata": {},
"source": [
"# Natural Language Processing\n",
"# NATURAL LANGUAGE PROCESSING\n",
"---"
]
},
Expand All @@ -19,8 +19,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Julia Version 1.11.1\n",
"Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)\n",
"Julia Version 1.11.2\n",
"Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)\n",
"Build Info:\n",
" Official https://julialang.org/ release\n",
"Platform Info:\n",
Expand All @@ -30,14 +30,14 @@
" LLVM: libLLVM-16.0.6 (ORCJIT, skylake)\n",
"Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)\n",
"Environment:\n",
" LD_LIBRARY_PATH = /home/mhamdi/torch/install/lib:/home/mhamdi/torch/install/lib:/home/mhamdi/torch/install/lib:\n",
" DYLD_LIBRARY_PATH = /home/mhamdi/torch/install/lib:/home/mhamdi/torch/install/lib:/home/mhamdi/torch/install/lib:\n",
" LD_LIBRARY_PATH = /home/mhamdi/torch/install/lib:/home/mhamdi/torch/install/lib:/home/mhamdi/torch/install/lib:\n",
" JULIA_NUM_THREADS = 8\n"
]
}
],
"source": [
"versioninfo() # -> v\"1.11.1\""
"versioninfo() # -> v\"1.11.2\""
]
},
{
Expand Down Expand Up @@ -361,7 +361,7 @@
"id": "be552738-c7a0-479b-9e61-c17e85187a52",
"metadata": {},
"source": [
"**Part-of-speech tags**\""
"**Part-of-speech tags**"
]
},
{
Expand Down Expand Up @@ -409,13 +409,6 @@
"id": "035bb1c4-e30c-431b-b527-51fadcbe3622",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mPrecompiling Embeddings [c5bfea45-b7f1-5224-a596-15500f5db411] (cache misses: wrong dep version loaded (2))\n"
]
},
{
"data": {
"text/plain": [
Expand Down Expand Up @@ -724,7 +717,7 @@
{
"data": {
"text/plain": [
"(sparse([1, 2, 2, 2, 1, 2, 1, 2, 1, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], 2, 10), [0.5; 0.5;;])"
"(sparse([1, 1, 1, 1, 1, 1, 2, 1, 1, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.5, 0.125, 0.125, 0.5], 2, 10), [0.8; 0.2;;])"
]
},
"execution_count": 25,
Expand All @@ -737,21 +730,21 @@
"iterations = 1000 # number of Gibbs sampling iterations\n",
"α = 0.1 # hyper parameter\n",
"β = 0.1 # hyper parameter\n",
"ϕ, θ = lda(m, k, iterations, α, β) # "
"ϕ, θ = lda(m, k, iterations, α, β) "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.11.1",
"display_name": "IJulia 1.11.2",
"language": "julia",
"name": "julia-1.11"
"name": "ijulia-1.11"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.11.1"
"version": "1.11.2"
}
},
"nbformat": 4,
Expand Down
10 changes: 3 additions & 7 deletions Codes/Julia/Part-3/nlp/nlp.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.20.3
# v0.20.4

#> [frontmatter]
#> title = "Natural Language Processing"
Expand Down Expand Up @@ -29,10 +29,7 @@ using LinearAlgebra
md"# NATURAL LANGUAGE PROCESSING"

# ╔═╡ 384c0666-27c6-4bc8-8e9d-c20d0fd3c919
versioninfo() # -> v"1.11.1"

# ╔═╡ 8bbf13dd-9faf-4566-91a4-cba2759048f6
cd(@__DIR__)
versioninfo() # -> v"1.11.2"

# ╔═╡ f336e7e2-99ae-4b91-8f93-0607eede9773
txt = "The quick brown fox is jumping over the lazy dog" # Pangram [modif.]
Expand Down Expand Up @@ -226,7 +223,7 @@ iterations = 1000 # number of Gibbs sampling iterations
β = 0.1 # hyper parameter

# ╔═╡ 92520517-1ba9-4436-9472-91699cb2b56c
ϕ, θ = lda(m, k, iterations, α, β) #
ϕ, θ = lda(m, k, iterations, α, β)

# ╔═╡ 1b94b44f-2c26-463e-bb24-2e8b895a2b5a
html"""
Expand All @@ -243,7 +240,6 @@ html"""
# ╔═╡ Cell order:
# ╠═d8292e75-d298-4e8e-b7bb-acc848e01b4a
# ╠═384c0666-27c6-4bc8-8e9d-c20d0fd3c919
# ╠═8bbf13dd-9faf-4566-91a4-cba2759048f6
# ╠═5f3b5700-d705-477d-8f20-6d09ecb4a8b3
# ╠═bf1da4bc-48f4-4042-a7ab-e042bbd32d41
# ╠═f336e7e2-99ae-4b91-8f93-0607eede9773
Expand Down

0 comments on commit fa96da8

Please sign in to comment.