mirror of
https://github.com/aladdinpersson/Machine-Learning-Collection.git
synced 2026-02-21 11:18:01 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
language1
|
||||
i love tuna
|
||||
i love potato
|
||||
i love bacon
|
||||
|
@@ -0,0 +1,4 @@
|
||||
language2,
|
||||
jag älskar tonfisk
|
||||
jag älskar potatis
|
||||
jag älskar bacon
|
||||
|
@@ -0,0 +1,7 @@
|
||||
index,type,label,file,review
|
||||
0,test,neg,0_2.txt,"Once again Mr. Costner has dragged out a movie for far longer than necessary. Aside from the terrific sea rescue sequences, of which there are very few I just did not care about any of the characters. Most of us have ghosts in the closet, and Costner's character are realized early on, and then forgotten until much later, by which time I did not care. The character we should really care about is a very cocky, overconfident Ashton Kutcher. The problem is he comes off as kid who thinks he's better than anyone else around him and shows no signs of a cluttered closet. His only obstacle appears to be winning over Costner. Finally when we are well past the half way point of this stinker, Costner tells us all about Kutcher's ghosts. We are told why Kutcher is driven to be the best with no prior inkling or foreshadowing. No magic here, it was all I could do to keep from turning it off an hour in."
|
||||
1,test,neg,10000_4.txt,"This is an example of why the majority of action films are the same. Generic and boring, there's really nothing worth watching here. A complete waste of the then barely-tapped talents of Ice-T and Ice Cube, who've each proven many times over that they are capable of acting, and acting well. Don't bother with this one, go see New Jack City, Ricochet or watch New York Undercover for Ice-T, or Boyz n the Hood, Higher Learning or Friday for Ice Cube and see the real deal. Ice-T's horribly cliched dialogue alone makes this film grate at the teeth, and I'm still wondering what the heck Bill Paxton was doing in this film? And why the heck does he always play the exact same character? From Aliens onward, every film I've seen with Bill Paxton has him playing the exact same irritating character, and at least in Aliens his character died, which made it somewhat gratifying...<br /><br />Overall, this is second-rate action trash. There are countless better films to see, and if you really want to see this one, watch Judgement Night, which is practically a carbon copy but has better acting and a better script. The only thing that made this at all worth watching was a decent hand on the camera - the cinematography was almost refreshing, which comes close to making up for the horrible film itself - but not quite. 4/10."
|
||||
2,test,neg,10001_1.txt,"First of all I hate those moronic rappers, who could'nt act if they had a gun pressed against their foreheads. All they do is curse and shoot each other and acting like cliché'e version of gangsters.<br /><br />The movie doesn't take more than five minutes to explain what is going on before we're already at the warehouse There is not a single sympathetic character in this movie, except for the homeless guy, who is also the only one with half a brain.<br /><br />Bill Paxton and William Sadler are both hill billies and Sadlers character is just as much a villain as the gangsters. I did'nt like him right from the start.<br /><br />The movie is filled with pointless violence and Walter Hills specialty: people falling through windows with glass flying everywhere. There is pretty much no plot and it is a big problem when you root for no-one. Everybody dies, except from Paxton and the homeless guy and everybody get what they deserve.<br /><br />The only two black people that can act is the homeless guy and the junkie but they're actors by profession, not annoying ugly brain dead rappers.<br /><br />Stay away from this crap and watch 48 hours 1 and 2 instead. At lest they have characters you care about, a sense of humor and nothing but real actors in the cast."
|
||||
3,test,neg,10002_3.txt,"Not even the Beatles could write songs everyone liked, and although Walter Hill is no mop-top he's second to none when it comes to thought provoking action movies. The nineties came and social platforms were changing in music and film, the emergence of the Rapper turned movie star was in full swing, the acting took a back seat to each man's overpowering regional accent and transparent acting. This was one of the many ice-t movies i saw as a kid and loved, only to watch them later and cringe. Bill Paxton and William Sadler are firemen with basic lives until a burning building tenant about to go up in flames hands over a map with gold implications. I hand it to Walter for quickly and neatly setting up the main characters and location. But i fault everyone involved for turning out Lame-o performances. Ice-t and cube must have been red hot at this time, and while I've enjoyed both their careers as rappers, in my opinion they fell flat in this movie. It's about ninety minutes of one guy ridiculously turning his back on the other guy to the point you find yourself locked in multiple states of disbelief. Now this is a movie, its not a documentary so i wont waste my time recounting all the stupid plot twists in this movie, but there were many, and they led nowhere. I got the feeling watching this that everyone on set was sord of confused and just playing things off the cuff. There are two things i still enjoy about it, one involves a scene with a needle and the other is Sadler's huge 45 pistol. Bottom line this movie is like domino's pizza. Yeah ill eat it if I'm hungry and i don't feel like cooking, But I'm well aware it tastes like crap. 3 stars, meh."
|
||||
4,test,neg,10003_3.txt,"Brass pictures (movies is not a fitting word for them) really are somewhat brassy. Their alluring visual qualities are reminiscent of expensive high class TV commercials. But unfortunately Brass pictures are feature films with the pretense of wanting to entertain viewers for over two hours! In this they fail miserably, their undeniable, but rather soft and flabby than steamy, erotic qualities non withstanding.<br /><br />Senso '45 is a remake of a film by Luchino Visconti with the same title and Alida Valli and Farley Granger in the lead. The original tells a story of senseless love and lust in and around Venice during the Italian wars of independence. Brass moved the action from the 19th into the 20th century, 1945 to be exact, so there are Mussolini murals, men in black shirts, German uniforms or the tattered garb of the partisans. But it is just window dressing, the historic context is completely negligible.<br /><br />Anna Galiena plays the attractive aristocratic woman who falls for the amoral SS guy who always puts on too much lipstick. She is an attractive, versatile, well trained Italian actress and clearly above the material. Her wide range of facial expressions (signalling boredom, loathing, delight, fear, hate ... and ecstasy) are the best reason to watch this picture and worth two stars. She endures this basically trashy stuff with an astonishing amount of dignity. I wish some really good parts come along for her. She really deserves it."
|
||||
5,test,neg,10004_2.txt,"A funny thing happened to me while watching ""Mosquito"": on the one hand, the hero is a deaf-mute and the director is totally unable to make us understand why he does what he does (mutilating mannequins...er, excuse me, corpses) through his images. On the other hand, the English version at least is very badly dubbed. So I found myself wishing there had been both more AND less dialogue at the same time! This film is stupid (funny how this guy has access to every graveyard and mortuary in his town) and lurid (where would we be in a 70s exploitationer without our gratuitous lesbian scene?). Not to mention the ""romantic"" aspect (oh, how sweet!)...Miss it. (*)"
|
||||
|
@@ -0,0 +1,9 @@
|
||||
index,type,label,file,review
|
||||
6,test,neg,10005_2.txt,"This German horror film has to be one of the weirdest I have seen.<br /><br />I was not aware of any connection between child abuse and vampirism, but this is supposed based upon a true character.<br /><br />Our hero is deaf and mute as a result of repeated beatings at the hands of his father. he also has a doll fetish, but I cannot figure out where that came from. His co-workers find out and tease him terribly.<br /><br />During the day a mild-manner accountant, and at night he breaks into cemeteries and funeral homes and drinks the blood of dead girls. They are all attractive, of course, else we wouldn't care about the fact that he usually tears their clothing down to the waist. He graduates eventually to actually killing, and that is what gets him caught.<br /><br />Like I said, a very strange movie that is dark and very slow as Werner Pochath never talks and just spends his time drinking blood."
|
||||
7,test,neg,10006_2.txt,"Being a long-time fan of Japanese film, I expected more than this. I can't really be bothered to write to much, as this movie is just so poor. The story might be the cutest romantic little something ever, pity I couldn't stand the awful acting, the mess they called pacing, and the standard ""quirky"" Japanese story. If you've noticed how many Japanese movies use characters, plots and twists that seem too ""different"", forcedly so, then steer clear of this movie. Seriously, a 12-year old could have told you how this movie was going to move along, and that's not a good thing in my book.<br /><br />Fans of ""Beat"" Takeshi: his part in this movie is not really more than a cameo, and unless you're a rabid fan, you don't need to suffer through this waste of film.<br /><br />2/10"
|
||||
8,test,neg,10007_4.txt,"""Tokyo Eyes"" tells of a 17 year old Japanese girl who falls in like with a man being hunted by her big bro who is a cop. This lame flick is about 50% filler and 50% talk, talk, and more talk. You'll get to see the less than stellar cast of three as they talk on the bus, talk and play video games, talk and get a haircut, talk and walk and walk and talk, talk on cell phones, hang out and talk, etc. as you read subtitles waiting for something to happen. The thin wisp of a story is not sufficient to support a film with low end production value, a meager cast, and no action, no romance, no sex or nudity, no heavy drama...just incessant yadayadayada'ing. (C-)"
|
||||
9,test,neg,10008_4.txt,"Wealthy horse ranchers in Buenos Aires have a long-standing no-trading policy with the Crawfords of Manhattan, but what happens when the mustachioed Latin son falls for a certain Crawford with bright eyes, blonde hair, and some perky moves on the dance floor? 20th Century-Fox musical has a glossy veneer yet seems a bit tatty around the edges. It is very heavy on the frenetic, gymnastic-like dancing, exceedingly thin on story. Betty Grable (an eleventh hour replacement for Alice Faye) gives it a boost, even though she's paired with leaden Don Ameche (in tan make-up and slick hair). Also good: Charlotte Greenwood as Betty's pithy aunt, a limousine driver who's constantly asleep on the job, and Carmen Miranda playing herself (who else?). The stock shots of Argentina far outclass the action filmed on the Fox backlot, and some of the supporting performances are quite awful. By the time of the big horserace finale, most viewers will have had enough. *1/2 from ****"
|
||||
10,test,neg,10009_3.txt,"Cage plays a drunk and gets high critically praise. Elizabeth Shue Actually has to do a love seen with the most unattractive and overrated piece of dung flesh in Hollywood. I literally vomited while watching this film. Of course I had the flu, but that does not mean this film did not contribute to the vomit in the kamode. <br /><br />Why can't Nick Cage play something he can really pull off like a bad actor. Nick Cage who be brilliant in a role as a bad actor. Heck nobody could do it better.<br /><br />The search begins for Nick's contract with Lucifer or was it Lou Cipher from ""Night Train To Terror""."
|
||||
11,test,neg,1000_3.txt,"First of all, I would like to say that I am a fan of all of the actors that appear in this film and at the time that I rented it, I wanted to like it.<br /><br />I think that the main reason that I was so disappointed was that the outside box promised me a suspense thriller. In my eyes, a suspense thriller for British movies is like something out of a Ruth Rendell novel, something that has a lot of dark twist and turns and leaves the viewer with an ending that is unlikely to be forgotten anytime soon.<br /><br />This movie started out with the promising note of being such a film. We have our main character, that suspects a man that he does not like, of being involved in a hit and run that killed the husband of one of his servants.His notions prove to be right, but the idea that his wife might be involved, does not occur to him until that she confesses to him that she was a part of the crime.<br /><br />The elements of a good suspense thriller were in place, at this point, but from there, I felt that the film took a different direction and became almost some sort of a mild soap opera about who wants to be with who and what the love of a real relationship is. The film might have been enjoyable to me, if the outside box had talked of a twisted lover's triangle and had not been labeled as suspense thriller.This seemed to be more of a soap opera story and the beginning setting seemed to be a mild distraction to the true content of the film. I felt like this film could have done a whole lot better than it did. I felt like it kept leading the viewer up to a big event that never materialized. So, I have to give it a lower rating than I would have liked to and say that it fell short of my expectations."
|
||||
12,test,neg,10010_2.txt,"So tell me - what serious boozer drinks Budweiser? How many suicidally-obsessed drinkers house a fully stocked and barely touched range of drinks in their lonely motel room that a millionaire playboy's bachelor-pad bar would be proud to boast? And what kind of an alcoholic tends to drink with the bottle held about 8 inches from his hungry mouth so that the contents generally spill all over his face? Not to mention wasting good whisky by dousing your girlfriend's tits with it, just so the cinema audience can get a good eyeful of Elisabeth Shue's assets.<br /><br />Cage seems to be portraying the most attention-seeking look-at-me alcoholic ever to have graced the screen while Shue looks more like a Berkely preppy slumming it for a summer than some seasoned street-walker. She is humiliated and subjugated as often as possible in this revolting movie with beatings, skin lacerations, anal rape and graphic verbal abuse - all of it completely implausible and included apparently only to convey a sense of her horribly demeaned state and offer the male viewers an astonishingly clichéd sentimental sexual fantasy of the 'tart-with-a-heart'.<br /><br />Still - I did watch it to the end, by which time I was actually laughing out loud as Shue's tough street hooker chopped carrots in the kitchen wanly, pathetically smiling while Cage - all eyes popping and shaking like like a man operating a road drill in an earthquake - grimaced and mugged his way through the final half-hour..."
|
||||
13,test,neg,10011_1.txt,"A big disappointment for what was touted as an incredible film. Incredibly bad. Very pretentious. It would be nice if just once someone would create a high profile role for a young woman that was not a prostitute. <br /><br />We don't really learn anything about this character, except that he seems to be a hopeless alcoholic. We don't know why. Nicholas Cage turns in an excellent performance as usual, but I feel that this role and this script let him down. And how, after not being able to perform for the whole film, can he have an erection on his deathbed? Really terrible and I felt like I needed a bath."
|
||||
|
@@ -0,0 +1,11 @@
|
||||
index,type,label,file,review
|
||||
14,test,neg,10012_1.txt,"This film is absolutely appalling and awful. It's not low budget, it's a no budget film that makes Ed Wood's movies look like art. The acting is abysmal but sets and props are worse then anything I have ever seen. An ordinary subway train is used to transport people to the evil zone of killer mutants, Woddy Strode has one bullet and the fight scenes are shot in a disused gravel pit. There is sadism as you would expect from an 80s Italian video nasty. No talent was used to make this film. And the female love interest has a huge bhind- Italian taste maybe. Even for 80s Italian standards this film is pretty damn awful but I guess it came out at a time when there weren't so many films available on video or viewers weren't really discerning. This piece of crap has no entertainment value whatsoever and it's not even funny, just boring and extremely cheap. It's actually and insult to the most stupid audience. I just wonder how on earth an actor like Woody Strode ended up ia a turkey like this?"
|
||||
15,test,neg,10013_4.txt,"Here's a decidedly average Italian post apocalyptic take on the hunting/killing humans for sport theme ala The Most Dangerous Game, Turkey Shoot, Gymkata and The Running Man.<br /><br />Certainly the film reviewed here is nowhere near as much fun as the other listed entries and is furthermore dragged down by poor voice over work, generally bland action sequences, a number of entirely tasteless scenes such as a prolonged rape sequence and some truly stupid and illogical points throughout.<br /><br />Take for example towards the end of the film, when our hero manages to infiltrate the compound of the villains. He initially kills a sentry and leaves him in his jeep. Upon discovery of the said corpse, the villains response? (bearing in mind that our hero has come to brutally murder them all) Ã? They resolve to wait until the next morning to look for the culprit (!!!!!!!!!!)<br /><br />However, I suppose to be fair the film remains nonetheless about watchable if you can suspend your disbelief during such stupid scenes and does benefit immensely by the presence of the always excellent Woody Strode (even if his screen time is very limited)<br /><br />Not a classic by any stretch of the imagination but still just about worthy of a watch for Italian B-Movie enthusiasts."
|
||||
16,test,neg,10014_2.txt,"At the bottom end of the apocalypse movie scale is this piece of pish called 'The Final Executioner'.. at least where I come from. A bloke is trained by an ex-cop to seek vengeance on those that killed his woman and friends in cold blood.. and that's about it. Lots of fake explosions and repetitive shootings ensue. Has one of the weirdest array of costumes I've seen in a film for a while, and a massive fortress which is apparently only run by 7 people. GREAT job on the dubbing too guys(!) Best moment: when our hero loses a swordfight and is about to be skewered through the neck, he just gets out his gun and BANG! Why not do that earlier? It's a mystery. As is why anyone would want to sit through this in the first place. I'm still puzzling over that one myself now.. 2/10"
|
||||
17,test,neg,10015_4.txt,"Earth has been destroyed in a nuclear holocaust. Well, parts of the Earth, because somewhere in Italy, a band of purebred survivors--those without radioactive contamination--are holed up in a massive mansion surrounded by lush grounds, waiting for the next opportunity to go hunting for those with polluted blood. The Final Executioner is the story of one of their would be victims, Alan (William Mang, who looks, not surprisingly, a lot like Kurt Russell), and his efforts to take down the legally sanctioned hunters, who are led by Edra (Marina Costa) and Erasmus (Harrison Muller Jr. ). Alan has been trained to kill by former NYPD cop Sam (Woody Strode) who mostly hangs around giving his pupil moral support and mooching for tinned meat. Strode is by far the best thing about the film, though he doesn't look at all well and only appears for about a third of the running time. As for the story, it's a blending of elements from better films and stories, including Ten Little Indians, The Most Dangerous Game, and Escape From New York. The Final Executioner moves along at a fair pace and provides reasonable entertainment for less discriminate action fans."
|
||||
18,test,neg,10016_3.txt,"Many people are standing in front of the house n some women are crying... Men standing in close groups and speaking in hushed up tone... a couple of guys come in and they are discussing how sexy the daughter might look today... soon u will know someone in the house has died... The dead person's wife is worried about preparing food for so many people, her friend sitting beside her gives an idea of making the matters easy by preparing simple roti sabji... One of the dead person's son is speaking with someone over the mobile, Daughter is busy with her makeup... her mother suggests her to wear salwar kameej, but the daughter is more interested in looking good when so many people will be visiting their house and hence prefers jeans and T shirt over salwar kameez... another son asks her mom to finish all the kriyas and also indicates to her that he should not be expected to come early from the office... Then the camera slowly focuses on the dead person... the white cloth covering the face is displaced slightly due to the wind, revealing the face ... Its Anupam Kher... suddenly alarm rings and he gets up from the bed... Is it his dream or a flash back? U won't get an answer until the end of the movie...Well, This is wat comedy is for the director Dibakar Banerjee!!!!! Later u find out this scene has nothing to do with the actual movie and hence making everything obvious that the still described earlier was a dream. Is this a film comedy? Well it is supposed to belong to that category... But it actually does not!!! there is nothing that can be remotely associated with comedy in the movie!!! More over the director gives the message that no one will get justice from Police!!! so everyone must cheat the cheats!!!! or forget about Justice!!!! Music by Bapi-Tutul & Dhruv Dhalla is OK... Nothing much to tell about other sectors... Bad script destroys everything... not even Anupam Kher's performance succeeds in making it at least a paisa vasool..."
|
||||
19,test,neg,10017_1.txt,"New York family is the last in their neighborhood to get a television set, which nearly ruins David Niven's marriage to Mitzi Gaynor. Bedroom comedy that rarely ventures into the bedroom(and nothing sexy happens there anyway). Gaynor as an actress has about as much range as an oven--she turns on, she turns off. Film's sole compensation is a supporting performance by perky Patty Duke, pre-""Miracle Worker"", as Niven's daughter. She's delightful; ""Happy Anniversary"" is not. * from ****"
|
||||
20,test,neg,10018_1.txt,"The best thing about ""The Prey"" is the tag line...""It's not human and it's got an axe""! The movie itself is a padded stinkaroo....endless insect and wildlife shots make the viewer wanna die! No slasher fan will like this garbage.....Watch ""Friday the 13th"" again and burn any copy of this film you find! <br /><br />It also rates as one of the 25 worst films ever made!"
|
||||
21,test,neg,10019_1.txt,"This is truly, without exaggerating, one of the worst Slasher movies ever made. I know, it came out in the 80's following a tendency started by ""Friday the 13th"". ""The Prey"" copies the fore-mentioned movie in many aspects. The woods setting, the killer, the dumb teens, the gore, etc.<br /><br />But ""The Prey"" is as bad as you might expect. I didn't even remember about it if it wasn't for coincidence.<br /><br />Well, the killer is in fact human so don't expect a supernatural killer in the likes of Jason. The situations rather boring and lack of tension, gore, violence, etc. It just does not works for a slasher flick.<br /><br />The acting is simply horrid. The score is horrible! a combination of boring instruments with cheesy 80's tunes?! I won't even mention the technical aspects of the movie because believe me, it seems that it cost only 20 dollars.<br /><br />Please avoid this one like the plague. It's one of the worst movies I've ever seen, and that's something to say. Thank God it seems to have vanished from earth."
|
||||
22,test,neg,1001_4.txt,"I'm a huge fan of both Emily Watson (Breaking The Waves) and Tom Wilkinson (Normal) and was amused to see them upstaged by Rupert Everett (Dellamorte Dellamore) in this shockingly rather minor movie that had all the ingredients to be so much more. The too brief scenes in which he portrays a languid, infinitely entitled, worthless son of a rich Lord are spot-on and entertaining. But for a love triangle there was remarkably little chemistry to speak of between anyone. The music was annoyingly movie-of-the-week quality, and the voice-over jarring and totally unnecessary. Clearly the work of a first-time director with a small budget who either lacked or didn't sufficiently heed good advice. Too bad.<br /><br />I can appreciate how the people you kind of hate at the beginning are the ones you kind of like at the end, and vice-versa, so there is some sort of character arc, at least in terms of perception. For example, Watson's character, while refreshingly honest to her husband about her feelings for another man, began to grate on me near the end, particularly when she announced to her husband that she simply had absolutely no control over her actions, and later when she simply declared that she would be moving back into their marital flat, with no asking of permission, no apologies offered. And I went from disliking Wilkinson's control freak / moral relativist character to sort of understanding him and not really wanting him to change (unlike his wife).<br /><br />This movie awkwardly morphed from a whodunit to a ""Love Story"" or ""Steel Magnolias"" illness drama without sufficiently informing me of the fact, so I was left distractedly guessing what the next plot twist might be long after they had all been revealed (Was it the Lord driving the car? The Lord's dog?). The scene where the Lord visits Wilkinson and relates how brave Watson is, the bestest nurse any dying boyfriend could ever ask for, Florence Nightingale incarnate, etc. was OK until he started over-the-top sobbing like a baby. Good God! If you ask me she's just another flitty rich person with way too much time on her hands, and so she drives her hard working, well providing spouse crazy with unnecessary drama. Her screwing around was just another way to occupy her empty life; the dying guy thing was an added bonus for her as it somehow made her previous actions completely above reproach.<br /><br />Look, everyone would have been better off if Wilkinson had just left her for his secretary, who seemed to appreciate him for who he was. Instead he acted like an abused dog, his open craving for his wife's affection increasing with every kick she gives him. I'm not anti PC or anything, it just didn't ring true, even after taking into account all of the harsh realities of middle age we all tend to face. The ending for me was (and not the director's intention I am certain) depressing. The movie spent the last 80 minutes convincing me that these two people just don't belong together, so I found no joy in the promise of their relationship continuing. I'm not above wanting my emotions manipulated by a story, it just has to be somewhat plausible and not hackneyed. Is that asking too much?<br /><br />My score: 4/10"
|
||||
23,test,neg,10020_1.txt,"Sure, most of the slasher films of the 1980's were not worth the<br /><br />celluloid they were filmed on, but this video nightmare may well be<br /><br />the dullest produced.<br /><br />Six horny pot smoking students decide to go camping. Of course,<br /><br />and you know this already, they begin getting killed one by one by a<br /><br />mysterious stranger. The climax has a hunky forest ranger trying to<br /><br />get to the teens in time before the last cute girl becomes buzzard<br /><br />bait.<br /><br />John Carl Buechler, my least favorite B-movie guy, did the lousy<br /><br />makeup effects here. The cast features Carel Struycken, of ""The<br /><br />Witches of Eastwick"" and the Addams family movies. Sadly, he<br /><br />does not pop up until the very end of the film, and is covered in<br /><br />burn makeup, rendering him unrecognizable. Steve Bond (anyone<br /><br />remember him?) is here in an early role as a victim.<br /><br />Brown's direction, and the script he cowrote, both smell like the<br /><br />presents brown bears leave in the woods. He pads the film with<br /><br />so much stock wilderness footage, I thought I accidentally rented a<br /><br />special episode of Mutual of Omaha's Wild Kingdom. Much of the<br /><br />cast sits around the campfire and eats, then walk, and sit and eat<br /><br />again. The forest ranger is involved in the strangest scene ever put<br /><br />in a slasher film: he tells a joke about a wide mouthed frog to a<br /><br />baby deer. Jackie Coogan, who must have forgot he once worked<br /><br />with the legends of silent cinema, has two scenes, and is involved<br /><br />in the second strangest scene ever put in a slasher film: he and<br /><br />the hunky forest ranger have a conversation about cucumber and<br /><br />cream cheese sandwiches on oatmeal bread...yeah.<br /><br />There is not one minute of suspense here. The killer, a forest fire<br /><br />survivor looking for a mate, watches the students from behind<br /><br />trees. We know it is the killer because the film makers have<br /><br />dubbed in a heart beat sound effect that helpfully serves to wake<br /><br />the viewer up every few minutes. Skip this pile of pine sap and rent<br /><br />""Halloween,"" instead.<br /><br />This is rated (R) for physical violence, mild gun violence, gore,<br /><br />some profanity, brief female nudity, mild sexual content, sexual<br /><br />references, and drug abuse."
|
||||
|
@@ -0,0 +1,170 @@
|
||||
import os
|
||||
|
||||
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
|
||||
import tensorflow as tf
|
||||
import pandas as pd
|
||||
import tensorflow_datasets as tfds
|
||||
from tensorflow import keras
|
||||
from tensorflow.keras import layers
|
||||
import pickle
|
||||
|
||||
tokenizer = tfds.features.text.Tokenizer()
|
||||
|
||||
english = tf.data.TextLineDataset("english.csv")
|
||||
swedish = tf.data.TextLineDataset("swedish.csv")
|
||||
dataset = tf.data.Dataset.zip((english, swedish))
|
||||
|
||||
for eng, swe in dataset.skip(1):
|
||||
print(tokenizer.tokenize(eng.numpy()))
|
||||
print(tokenizer.tokenize(swe.numpy().decode("UTF-8")))
|
||||
|
||||
# TODO:
|
||||
# 1. vocabulary (for each language)
|
||||
# 2. tokenize and numericalize words
|
||||
# 3. padded_batch, create model
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
sys.exit()
|
||||
|
||||
|
||||
## Example if you have multiple files
|
||||
file_names = ["test_example1.csv", "test_example2.csv", "test_example3.csv"]
|
||||
dataset = tf.data.TextLineDataset(file_names)
|
||||
|
||||
dataset1 = tf.data.TextLineDataset("test_example1.csv").skip(1) # .map(preprocess1)
|
||||
dataset2 = tf.data.TextLineDataset("test_example2.csv").skip(1) # .map(preprocess1)
|
||||
dataset3 = tf.data.TextLineDataset("test_example3.csv").skip(1) # .map(preprocess1)
|
||||
|
||||
dataset = dataset1.concatenate(dataset2).concatenate(dataset3)
|
||||
|
||||
for line in dataset:
|
||||
print(line)
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
sys.exit()
|
||||
|
||||
|
||||
def filter_train(line):
|
||||
split_line = tf.strings.split(line, ",", maxsplit=4)
|
||||
dataset_belonging = split_line[1] # train, test
|
||||
sentiment_category = split_line[2] # pos, neg, unsup
|
||||
|
||||
return (
|
||||
True
|
||||
if dataset_belonging == "train" and sentiment_category != "unsup"
|
||||
else False
|
||||
)
|
||||
|
||||
|
||||
def filter_test(line):
|
||||
split_line = tf.strings.split(line, ",", maxsplit=4)
|
||||
dataset_belonging = split_line[1] # train, test
|
||||
sentiment_category = split_line[2] # pos, neg, unsup
|
||||
|
||||
return (
|
||||
True if dataset_belonging == "test" and sentiment_category != "unsup" else False
|
||||
)
|
||||
|
||||
|
||||
ds_train = tf.data.TextLineDataset("imdb.csv").filter(filter_train)
|
||||
ds_test = tf.data.TextLineDataset("imdb.csv").filter(filter_test)
|
||||
|
||||
# TODO:
|
||||
# 1. Create vocabulary
|
||||
# 2. Numericalize text str -> indices (TokenTextEncoder)
|
||||
# 3. Pad the batches so we can send in to an RNN for example
|
||||
|
||||
tokenizer = tfds.features.text.Tokenizer()
|
||||
# 'i love banana' -> ['i', 'love', 'banana'] -> [0, 1, 2]
|
||||
|
||||
|
||||
def build_vocabulary(ds_train, threshold=200):
|
||||
""" Build a vocabulary """
|
||||
frequencies = {}
|
||||
vocabulary = set()
|
||||
vocabulary.update(["sostoken"])
|
||||
vocabulary.update(["eostoken"])
|
||||
|
||||
for line in ds_train.skip(1):
|
||||
split_line = tf.strings.split(line, ",", maxsplit=4)
|
||||
review = split_line[4]
|
||||
tokenized_text = tokenizer.tokenize(review.numpy().lower())
|
||||
|
||||
for word in tokenized_text:
|
||||
if word not in frequencies:
|
||||
frequencies[word] = 1
|
||||
|
||||
else:
|
||||
frequencies[word] += 1
|
||||
|
||||
# if we've reached the threshold
|
||||
if frequencies[word] == threshold:
|
||||
vocabulary.update(tokenized_text)
|
||||
|
||||
return vocabulary
|
||||
|
||||
|
||||
# Build vocabulary and save it to vocabulary.obj
|
||||
vocabulary = build_vocabulary(ds_train)
|
||||
vocab_file = open("vocabulary.obj", "wb")
|
||||
pickle.dump(vocabulary, vocab_file)
|
||||
|
||||
# Loading the vocabulary
|
||||
# vocab_file = open("vocabulary.obj", "rb")
|
||||
# vocabulary = pickle.load(vocab_file)
|
||||
|
||||
encoder = tfds.features.text.TokenTextEncoder(
|
||||
list(vocabulary), oov_token="<UNK>", lowercase=True, tokenizer=tokenizer,
|
||||
)
|
||||
|
||||
|
||||
def my_encoder(text_tensor, label):
|
||||
encoded_text = encoder.encode(text_tensor.numpy())
|
||||
return encoded_text, label
|
||||
|
||||
|
||||
def encode_map_fn(line):
|
||||
split_line = tf.strings.split(line, ",", maxsplit=4)
|
||||
label_str = split_line[2] # neg, pos
|
||||
review = "sostoken " + split_line[4] + " eostoken"
|
||||
label = 1 if label_str == "pos" else 0
|
||||
|
||||
(encoded_text, label) = tf.py_function(
|
||||
my_encoder, inp=[review, label], Tout=(tf.int64, tf.int32),
|
||||
)
|
||||
|
||||
encoded_text.set_shape([None])
|
||||
label.set_shape([])
|
||||
return encoded_text, label
|
||||
|
||||
|
||||
AUTOTUNE = tf.data.experimental.AUTOTUNE
|
||||
ds_train = ds_train.map(encode_map_fn, num_parallel_calls=AUTOTUNE).cache()
|
||||
ds_train = ds_train.shuffle(25000)
|
||||
ds_train = ds_train.padded_batch(32, padded_shapes=([None], ()))
|
||||
|
||||
ds_test = ds_test.map(encode_map_fn)
|
||||
ds_test = ds_test.padded_batch(32, padded_shapes=([None], ()))
|
||||
|
||||
model = keras.Sequential(
|
||||
[
|
||||
layers.Masking(mask_value=0),
|
||||
layers.Embedding(input_dim=len(vocabulary) + 2, output_dim=32,),
|
||||
layers.GlobalAveragePooling1D(),
|
||||
layers.Dense(64, activation="relu"),
|
||||
layers.Dense(1),
|
||||
]
|
||||
)
|
||||
|
||||
model.compile(
|
||||
loss=keras.losses.BinaryCrossentropy(from_logits=True),
|
||||
optimizer=keras.optimizers.Adam(3e-4, clipnorm=1),
|
||||
metrics=["accuracy"],
|
||||
)
|
||||
|
||||
model.fit(ds_train, epochs=15, verbose=2)
|
||||
model.evaluate(ds_test)
|
||||
Reference in New Issue
Block a user